Community
Navisworks API
Welcome to Autodesk’s Navisworks API Forums. Share your knowledge, ask questions, and explore popular Navisworks API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Create Tags / RedLines in the API

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
igor.barcelosC54YD
514 Views, 4 Replies

Create Tags / RedLines in the API

Hi, 

 

Is there any way of creating tags like below using the C# API ? 

https://help.autodesk.com/view/NAV/2023/ENU/?guid=GUID-E58E6979-EA8D-4C58-BAA2-2879BD493420

 

Thanks 

4 REPLIES 4
Message 2 of 5

Hi @igor.barcelosC54YD ,

Please take a look at this below code

 Document doc = Autodesk.Navisworks.Api.Application.ActiveDocument;
 Autodesk.Navisworks.Api.View view = doc.ActiveView;
 string getRedLines = view.GetRedlines();

 // The value of "getRedLines" will resemble the value I've set in the "s" variable.
 // By adjusting the value of "s", you can customize your own set of red lines.

 string s = "{\"Type\":\"RedlineCollection\",\"Version\":1,\"Values\":[{\"Type\":\"RedlineEllipse\",\"Version\":1,\"Thickness\":3,\"Color\":[1,0,0],\"MinPoint\":[-0.45388908606868772,0.3369782608691772],\"MaxPoint\":[0.54593652310359631,-0.2248285099990586]}]}";
 view.TrySetRedlines(s);

Naveen Kumar T
Developer Technical Services
Autodesk Developer Network

Message 3 of 5

Hi, thanks a lot for your return.

 

if I may, I have two more questions : 

1/  I could drawn the circle with your code like shown in the image below. The problem is that when I change the camera (scrolling or padding) the ellips dissapears. How can I append this to the current view ? 

igorbarcelosC54YD_0-1712587309001.png

 

2/ My final goal is to achieve an similar result as the 'markups' in Forge like below. Any ideas ? Going with the redLines is an good idea ? 

igorbarcelosC54YD_1-1712587377028.png

 

Thank you ! 

Message 4 of 5

You must use RenderPlugin for it. It allows you to draw over the render in 3D or in 2D.

Message 5 of 5

Thanks a lot, I could do it using  RenderPlugin.

 

igorbarcelosC54YD_0-1712673439469.png

 

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

Post to forums  

Rail Community


 

Autodesk Design & Make Report