PDA

View Full Version : Python - Extracting Curves from a curve List


RumorHazard
10-21-2009, 01:13 PM
Hi,

So I am trying to extract some subcurves from a curve object.

I think I have the correct code but it doesn't seem to work keeps crashing


xsi = Application
lm = xsi.LogMessage
from win32com.client import constants as c

'''
selObj = xsi.Selection

for objs in selObj:
oCrv = xsi.ApplyGenOp("ExtractEdgeLoopOp", "", objs, 3, c.siImmediateOperation, c.siKeepGenOpInputs )
'''
oCrv = xsi.Selection[0]

count = 1
for crvZ in oCrv.ActivePrimitive.Geometry.Curves:
lm("Sub Curve : " + str(crvZ.Index))
xsi.SelectObj(crvZ)
Application.ExtractFromComponents("ExtractSubCrvOp","", "eye_"+str(count)+"_crv", "", "siPersistentOperation", "siKeepGenOpInputs", "")
count += 1




the methods above works, but i have to pass in the object by selecting it and performing the extract function with an empty object so it retrieves the selected object, I would prefer to pass the crv directly into the extractFromComponent Function

The way it works is the user should select the curve object and it will extract all the individual curves that arn't joined to each other, so you will end up with multiple single curves, I think i may be passing in the wrong ActivePrimitive.Geometry.Curves object into the extractComponents

Thanks :D

CGTalk Moderation
10-21-2009, 01:13 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.