PDA

View Full Version : Detaching and Linking


DaveWortley
10-29-2007, 09:37 AM
This code detached my selected faces on Friday, but today it won't even detach the selected faces. Couldn't get it to link the detached object to the object it was detached from, or a dummy. help please?


convertTo $ PolyMeshObject

--carpaint

the_polyobj = $

the_polyobj.selectbymaterial 13

the_faces = getfaceselection the_polyobj

the_name = execute(the_polyobj.name + "carpaint_" as string)

polyOp.detachFaces the_polyobj the_faces asnode:true name:the_name --detach

the_detached = execute( "$" + the_polyobj.name + "carpaint_" as string)

select the_detached

select $'Site_NSTruck-CPIKUP01_carpaint_'

the_dummy = "$Dummy_" + thepolyobj.name

$.parent = the_dummy

decon
10-29-2007, 07:52 PM
could be a typo, but this seems to work:

--convertTo $ PolyMeshObject
the_polyobj = selection[1]
setSelectionLevel the_polyobj #face
the_polyobj.selectbymaterial 13
the_faces = getfaceselection the_polyobj
the_name = the_polyobj.name + "carpaint_" as string
polyOp.detachFaces the_polyobj the_faces asnode:true name:the_name
the_detached = execute( "$" + the_polyobj.name + "carpaint_"as string)
--select $'Site_NSTruck-CPIKUP01_carpaint_'
the_dummy = Dummy name:("$Dummy_" + the_polyobj.name as string)
the_detached.parent = the_dummy

CGTalk Moderation
10-29-2007, 07:52 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.