How to add a Footprint to another and rotate it?

kicad_mod1 = pcbnew.Footprint(name1)
kicad_mod1.setDescription(name1)
kicad_mod1.SetReference(‘main’)

kicad_mod2 = pcbnew.Footprint(name)
kicad_mod2.setDescription(name)
kicad_mod2.SetReference(‘OtherMod’)

kicad_mod1.append(kicad_mod2)

and how to rotate kicad_mod2?

I am using Application: (64-bit)

Version: (6.0.9), release build

Libraries:
wxWidgets 3.2.1
libcurl/7.83.1-DEV Schannel zlib/1.2.12

Platform: Windows 10 (build 18363), 64-bit edition, 64 bit, Little endian, wxMSW

Build Info:
Date: Oct 29 2022 23:44:28
wxWidgets: 3.2.1 (wchar_t,wx containers)
Boost: 1.79.0
OCC: 7.6.0
Curl: 7.83.1-DEV
ngspice: 37
Compiler: Visual C++ 1929 without C++ ABI

Build settings:
KICAD_USE_OCC=ON
KICAD_SPICE=ON

any solution for this question?

Maybe you get better answers if you ask your question clearer.
It looks like you are attempting to do something in a script, but I’m not sure what.

KiCad V6 is also quite old, maybe new functions have been added to the scripting interface in the last two KiCad versions. If you really want to stick with KiCad V6, you should at least update to V6.0.11 Increments in the third number are bug fix releases, and have little other changes. Updating should always be safe, except for some caveats in the first one or two weeks after such an update.