Get layer color from layout 3D

Get layer color from layout 3D

Anonymous
Not applicable
1,153 Views
4 Replies
Message 1 of 5

Get layer color from layout 3D

Anonymous
Not applicable

Hi!

 

I need the layer color into 3d layout to paint the edge corresponding in 2D.

In the image below my situation:
1 - my asset;
2 - the appearance created to the layer
3 - the color of the layer in RGB.

 

erro.PNG

 

Thanks!

0 Likes
Accepted solutions (1)
1,154 Views
4 Replies
Replies (4)
Message 2 of 5

liqinomickey
Autodesk
Autodesk

Hi,

Have you tried our layer manager in Inventor Factory layout?

https://help.autodesk.com/view/FDU/2020/ENU/?guid=FDU_Inventor_Factory_Help_About_Creating_Factory_L...

Mickey



Mickey Li
Product Manager
ACS Docs Platform feature team
Autodesk, Inc.

0 Likes
Message 3 of 5

Anonymous
Not applicable

Hi

I am sorry, I was not specific with the goal of this reading.
I need this to paint the asset line in the idw file because today all lines are black or with other layers.

I need the same color in the 3D as the idw, to show colorful layouts for my customers.

Do you have a way to get this layers in idw file without API?

0 Likes
Message 4 of 5

liqinomickey
Autodesk
Autodesk

Hi Ederson,

When you said "show colorful layouts for my customers" are you referring to the 2D layout or the 3D layout. 

If 3D layout, we have the "Apply to 3D" option in "Layer Manager".

If 2D layout, we have the "Open in AutoCAD" (Sync to AutoCAD in 2019 and previous version) that will generate a AutoCAD DWG layout.

If you would like a 3D assets in their material color and 2D projection in Layer color, you will get it back to Inventor after Open in AutoCAD, and update the dwg underlay.

We didn't make additional support for idw. I am not sure if when creating the idw there is a way of importing the layout layers to idw layers.

Mickey



Mickey Li
Product Manager
ACS Docs Platform feature team
Autodesk, Inc.

0 Likes
Message 5 of 5

Anonymous
Not applicable
Accepted solution

Hi

My goal is shown in the images below.

2d.PNG3d.PNG

The same color in the layout 3d and in idw (2D) because we are going to use the idw file to show layouts for our clients.

 

Here is the code to do this:

public void UpdateColors(Application app)
{ DrawingDocument oDwg; oDwg = (DrawingDocument)app.ActiveDocument; Sheet oActive; oActive = oDwg.ActiveSheet; DrawingViews oDviews; oDviews = oActive.DrawingViews; foreach (DrawingView view in oDviews) { AssemblyColors(view, app); oDwg.Update(); } } private void AssemblyColors(DrawingView view, Application app) { DrawingCurveSegment segment = null; TransientObjects transient = app.TransientObjects; AssemblyDocument asss = (AssemblyDocument)view.ReferencedDocumentDescriptor.ReferencedDocument; foreach (DrawingCurve item in view.DrawingCurves) { segment = item.Segments[1]; try { if (segment.Layer.Name.ToUpper().Equals("VISIBLE EDGES(DIN)")) { EdgeProxy edge = (EdgeProxy)item.ModelGeometry; ComponentOccurrence occurrence = edge.ContainingOccurrence; foreach (Asset asslibs in asss.Assets) { if (asslibs.DisplayName.Equals(occurrence.Appearance.DisplayName)) { ColorAssetValue cor = (ColorAssetValue)asslibs["generic_diffuse"]; item.Color = transient.CreateColor(cor.Value.Red, cor.Value.Green, cor.Value.Blue); } } } } catch (Exception ex) { string e = ex.Message; } } } }

 

This Idea is good.

 

Thanks!

 

 

 

0 Likes