That would make sense, but my addNewComponent doesn't activate the component. I have attached a new screen cast where I have commented the line of code activating my component.
I don't know how to turn of the bar on the left side of the screen cast, but first the new sketch creates a sketch in the root component, at when activating one of my new components it creates the sketch in that component.
This is the setup code:
# setup Component
newAOcc = _destinationAComp.occurrences.addNewComponent(adsk.core.Matrix3D.create())
newBOcc = _destinationBComp.occurrences.addNewComponent(adsk.core.Matrix3D.create())
newAComp = newAOcc.component
newBComp = newBOcc.component
# apply appearance and name
newAOcc.appearance = _allAppearances.itemByName(colorString)
newBOcc.appearance = _allAppearances.itemByName(colorString)
newAComp.name = colorString + ' A'
newBComp.name = colorString + ' B'
#newAOcc.activate()
I find the destinationComps through the root.occurrences.itemByName and destinationOcc.component.
I am wondering if it has something to do with me not calling it on the root and instead calling it on components on the root.
- Erik