Unable to Change Visibility of Workplane Proxies in 2018
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
In order to make constraining easier, I have a macro which turns the visibility of work planes of components in an assembly on. With the 2018 modification to removing the ability to change library parts through API, it broke this functionality.
I've discovered I can do the same thing for the parts in the assembly by simply right clicking the workplanes in the browser and changing that items visibility. My research has pointed me to these being WorkPlane Proxies, and these workplane proxies are accessible through the API.
HOWEVER, I THINK the 2018 change may have inadvertently locked up these WorkPlane Proxies although they are still modifiable through the UI.
The code I am currently using is as below:
If someone can confirm this issue, I would be grateful. Thanks!
Sub ToggleOccWP(oDoc As Document, oObj As Variant) Dim oAssyCompDef As AssemblyComponentDefinition Set oAssyCompDef = oDoc.ComponentDefinition Set oOccurrences = oAssyCompDef.Occurrences.AllReferencedOccurrences(oObj) Dim oOccurrence As ComponentOccurrence Dim oSubAssyCompDef As ComponentDefinition For Each oOccurrence In oOccurrences Set oSubAssyCompDef = oOccurrence.Definition Dim oPlaneProxy As WorkPlaneProxy For Each oPlane In oSubAssyCompDef.WorkPlanes Call oOccurrence.CreateGeometryProxy(oPlane, oPlaneProxy) oPlaneProxy.Visible = True Next Dim oAxisProxy As WorkAxisProxy For Each oAxis In oSubAssyCompDef.WorkAxes Call oOccurrence.CreateGeometryProxy(oAxis, oAxisProxy) oAxisProxy.Visible = True Next Dim oWPoProxy As WorkPointProxy Call oOccurrence.CreateGeometryProxy(oSubAssyCompDef.WorkPoints(1), oWPoProxy) oWPoProxy.Visible = True Next End Sub
--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization
iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread
Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects
Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help
Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type