API - bug?? occurrences.add - and assembly configs
I'm trying to programmatically add a part to an assembly.
All is fine if I have a simple assembly (only contains parts) or a "complex" assembly (contains subassemblies. However, if I have a complex assembly with configurations, and I have configurations of subassemblies mapped to various configurations of the top assembly, the following fails....
'set session to first open assembly session
objADSession = objADRoot.Sessions.Item(persistant_as_item)
objADAssemblySession = objADSession
' Get Root Occurrence from Assembly Session
objADRootOccurrence = objADAssemblySession.RootOccurrence()
objADActiveOccurrence = objADAssemblySession.ActiveOccurrence()
MsgBox("activeoccurrence is " & objADActiveOccurrence.Name)
objADOccurrences = objADActiveOccurrence.Occurrences
objADDesignSession = objADSession
--i omitted the details of defining the ptransform----
Call objADOccurrences.Add("C:\\userdef\\dummy.AD_PRT", objADTransformation)
The correct active occurrence is set, but the command to "add" shown above fails.
Any ideas?
thanks,
cdub
I'm trying to programmatically add a part to an assembly.
All is fine if I have a simple assembly (only contains parts) or a "complex" assembly (contains subassemblies. However, if I have a complex assembly with configurations, and I have configurations of subassemblies mapped to various configurations of the top assembly, the following fails....
'set session to first open assembly session
objADSession = objADRoot.Sessions.Item(persistant_as_item)
objADAssemblySession = objADSession
' Get Root Occurrence from Assembly Session
objADRootOccurrence = objADAssemblySession.RootOccurrence()
objADActiveOccurrence = objADAssemblySession.ActiveOccurrence()
MsgBox("activeoccurrence is " & objADActiveOccurrence.Name)
objADOccurrences = objADActiveOccurrence.Occurrences
objADDesignSession = objADSession
--i omitted the details of defining the ptransform----
Call objADOccurrences.Add("C:\\userdef\\dummy.AD_PRT", objADTransformation)
The correct active occurrence is set, but the command to "add" shown above fails.
Any ideas?
thanks,
cdub