Create Tags / RedLines in the API

Create Tags / RedLines in the API

igor.barcelosC54YD
Enthusiast Enthusiast
1,375 Views
4 Replies
Message 1 of 5

Create Tags / RedLines in the API

igor.barcelosC54YD
Enthusiast
Enthusiast

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 

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

naveen.kumar.t
Autodesk Support
Autodesk Support

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

0 Likes
Message 3 of 5

igor.barcelosC54YD
Enthusiast
Enthusiast

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 ! 

0 Likes
Message 4 of 5

lanneauolivier
Advocate
Advocate
Accepted solution

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

0 Likes
Message 5 of 5

igor.barcelosC54YD
Enthusiast
Enthusiast

Thanks a lot, I could do it using  RenderPlugin.

 

igorbarcelosC54YD_0-1712673439469.png