THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 13/06/2011 at 02:03, xxxxxxxx wrote:
I'm starting to understand the usage of the send modelling command, but when i try to use it in a python object script it seems to crash c4d. below is the script that crashed c4d.
import c4d
#Welcome to the world of Python
def main() :
#define Bldg Variables
bldgHgt = op[c4d.ID_USERDATA, 1]
bldgWth = op[c4d.ID_USERDATA, 2]
flrHgt = op[c4d.ID_USERDATA, 3]
keepSqr = op[c4d.ID_USERDATA, 5]
bldgDepth = op[c4d.ID_USERDATA, 6]
#create Objects
cube = c4d.BaseObject(c4d.Ocube)
null = c4d.BaseObject(c4d.Onull)
#set cube under null such that base is always at Zero
axis = c4d.Vector(0,bldgHgt/2,0)
cube.InsertUnder(null)
cube.SetRelPos(axis)
#Set the bldg Perameters
cube[c4d.PRIM_CUBE_SUBY] = int(bldgHgt/flrHgt)
if(keepSqr==True) :
cube[c4d.PRIM_CUBE_LEN] = c4d.Vector(bldgWth,bldgHgt,bldgWth)
else :
cube[c4d.PRIM_CUBE_LEN] = c4d.Vector(bldgWth,bldgHgt,bldgDepth)
#Begin Contructing Windows
def MakeMulling(op,doc) :
settings = c4d.BaseContainer() # settings
settings[2037] = 5
doc.SetActiveObject(op)
c4d.CallCommand(12236)
c4d.CallCommand(12187)
c4d.CallCommand(12112)
c4d.utils.SendModelingCommand(command = c4d.ID_MODELING_EXTRUDE_INNER_TOOL,
list=op,
mode=c4d.MODELINGCOMMANDMODE_POLYGONSELECTION,
bc = settings,
doc = doc)
MakeMulling(op,doc)
#Pass the final object to document
return null
what is the correct usage for the send modelling command from within a python object?
function slideDown() { var dlt = document.getElementById("dllist"); dlt.setAttribute("style", "display:none;"); } function tB() { var tl = document.getElementById("linkbox"); var dl = document.getElementById("dltext"); if (tl.style.display=="none") { dl.style.display = "none"; tl.style.display = ""; } else { tl.style.display="none"; dl.style.display=""; } }