Message 1 of 7
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello community,
Trying to constrain workplanes. I was using some of the code that I found here in the forums and also on the API help samples on the Inventor suite. the problem I am having is that the "Componentdefinition" does not support the workplanes. In other words, when I write the code:
Dim oAsmCompDef As AssemblyComponentDefinition Set oAsmCompDef = ThisApplication.ActiveDocument.ComponentDefinition
Dim oOcc1 As ComponentOccurrence
Set oOcc1 = oAsmCompDef.Occurrences.Item(1)
Dim oOcc2 As ComponentOccurrence
Set oOcc2 = oAsmCompDef.Occurrences.Item(2)
' Get the XY plane from each occurrence. This goes to the ' component definition of the part to get this information. ' This is the same as accessing the part document directly. ' The work plane obtained is in the context of the part, ' not the assembly. Dim oPartPlane1 As WorkPlane Set oPartPlane1 = oOcc1.Definition.WorkPlanes.Item(3)
The last line "Occ1.definition" then the workplanes are NOT in the menu of objects that can be accessed through the definition
no workplanes
Can anyone help me with another way to access the workplanes so that I can complete the code?
I appreciate you guys help
Solved! Go to Solution.