How to make NonParametricBaseFeature non translucent using VBA

How to make NonParametricBaseFeature non translucent using VBA

Anonymous
Not applicable
429 Views
2 Replies
Message 1 of 3

How to make NonParametricBaseFeature non translucent using VBA

Anonymous
Not applicable

I could not find any property nor method in VBA for doing this:

Translucent.png

Part in question is imported .jt file.

0 Likes
Accepted solutions (1)
430 Views
2 Replies
Replies (2)
Message 2 of 3

BrianEkins
Mentor
Mentor
Accepted solution

The API could be better for this but it is possible.  The thing in the browser that you select to set if it's translucent or not is a WorkSurface object.  What's missing in the API is the ability to get to the work surface from either the base feature or the body that was created.  If you're doing the import of the STEP then you can know that the work surface just created will be the last one.  The code below takes advantage of that.

 

Public Sub SetOpaque()
    Dim partDoc As PartDocument
    Set partDoc = ThisApplication.ActiveDocument
    Dim comp As PartComponentDefinition
    Set comp = partDoc.ComponentDefinition
    
    Dim workSurf As WorkSurface
    Set workSurf = comp.WorkSurfaces.Item(comp.WorkSurfaces.Count)
    workSurf.Translucent = False
End Sub
---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com
Message 3 of 3

Anonymous
Not applicable

Thank you for your reply. It worked.

0 Likes