Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Get object size from Inventor drawing view (c#)

0 REPLIES 0
Reply
Message 1 of 1
greg.h
884 Views, 0 Replies

Get object size from Inventor drawing view (c#)

We have a requirement to match readability of Inventor drawings to an older system by colouring circles of certain sizes (so 5mm dia =blue, 10mm = green etc).

Im down to checking if teh DrawingCurve is circular, but am stuck getting its size.

Do I need to refer to the ModelGeometry. If so I cant find how to map that to an object i can check the size of?

code excerpt so far 

 

 

try
            {
                foreach (Sheet drawingSheet in drawingDoc.Sheets)
                {
                    foreach (DrawingView view in drawingSheet.DrawingViews)
                    {
                        foreach (DrawingCurve dwgCurve in view.DrawingCurves)
                        {
                            if (dwgCurve.CurveType == CurveTypeEnum.kCircleCurve)
                            {                                                                				DrawingCurveSegment dcs = (DrawingCurveSegment)dwgCurve.Segments[1];
                                //Code fails here
                                Circle2d circle = (Circle2d)dcs;
                                double circleDia = Convert.ToDouble(circle.Radius.ToString("0.00")) * 2;
                                Color clr = m_drawingCircleColours[circleDia];
                                if (clr != null) dwgCurve.Color = clr;
                            }
                        }
                    }
                }

            }

 

Any tips greatly appreciated

 

0 REPLIES 0

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report