Assign surface body to layer

Assign surface body to layer

DewayneH
Advocate Advocate
656 Views
2 Replies
Message 1 of 3

Assign surface body to layer

DewayneH
Advocate
Advocate

 

 

Basically, I'm attempting is to assign surface bodies to the phantom layer, for drawing views of parts.

 

We use surfaces quite a bit. Typically they are derived into a part for construction purposes.

 

There are times when we need the surfaces visible in the drawings, for reference.

The issue is, in the drawing environment surfaces are viewed as visible edges.

There is not a separate object default for surface edges. They are treated just like solids.

 

In our case, if we have surfaces in a part we need them to appear phantom in the views.

Currently, we manually find the surface body in the browser, select as edges, then change the layer to Phantom.

What I need is to automate that process...

Find the surface bodies in drawing views and change them to the Phantom layer.

 

I have found many examples of code to change layers and select bodies. I haven't found anything close to get to what I need.

 

It sounds simple, and probably is for the ilogic gurus.

 

Any assistance or direction would be greatly appreciated.

 

Thanks in advance,

Dewayne

 

 

Dewayne
Inventor Pro 2023
Vault Pro 2023
0 Likes
Accepted solutions (1)
657 Views
2 Replies
Replies (2)
Message 2 of 3

JaneFan
Autodesk
Autodesk
Accepted solution

Hey @DewayneH,

 

Layers can be set to drawing curve segments. Please try following code in iLogic which takes some certain drawing view and layer as example:

SyntaxEditor Code Snippet

Dim doc As DrawingDocument 
doc = ThisDoc.Document 

Dim oDC As DrawingCurve
Dim oDCS As DrawingCurveSegment 

For Each oDC In doc.Sheets(1).DrawingViews(1).DrawingCurves 
	For Each oDCS In oDC.Segments 
		If Not oDCS.Parent.ModelGeometry.Parent.IsSolid Then 
			oDCS.Layer = doc.StylesManager.Layers.Item(2)
		End If 
	Next 
Next 

Please update the code as your need.




Jane Fan
Inventor/Fusion QA Engineer
0 Likes
Message 3 of 3

DewayneH
Advocate
Advocate

 

 

This is exactly what I needed.

This is going to save us loads of work and time.

 

Jane, I am a fan.

 

Thank you, thank you!

Dewayne

Dewayne
Inventor Pro 2023
Vault Pro 2023
0 Likes