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: 

Retrieveing Redline data in Navisworks API

3 REPLIES 3
Reply
Message 1 of 4
sbieser01
1125 Views, 3 Replies

Retrieveing Redline data in Navisworks API

Is there a function to retrieve the redline annotation of a vewpoint in Navisworks API? I do see references to redlines elsewhere in the API Reference Manual such as AddRedlinesToCurrentSavedViewpoint in DocumentCurrentMeasurement, but I don't see a means to retreive the redline annotation information from a saved view point. Is this even possible in Navisworks API?

 

Thanks,

Scott.

3 REPLIES 3
Message 2 of 4
xiaodong_liang
in reply to: sbieser01

Hi,

 

Sorry, I do not either see an API. What you can access is only the information of current measurement.

Message 3 of 4
brian.k.smith
in reply to: sbieser01

Redlines can be retrieved from a View by using GetRedlines():

 

Public Function GetRedlines() As String

Member of Autodesk.Navisworks.Api.View

 

Summary:

Gets redlines in the form of a JSON RedlineCollection object.

 

Note: It will be necessary to deserialize the JSON string to a .NET object.  This is a current VB implementation:

 

'Class for the redline markup collection

Public Class Rootobject

Public Property Type As String

Public Property Version As Integer

Public Property Values() As Value()

End Class

'Class for the redline instances

Public Class Value

Public Property Type As String 'Type of redline

Public Property Version As Integer 'Redline version

Public Property Thickness As Integer 'Thickness

Public Property Color() As List(Of Double) 'Color (RGB values)

Public Property MinPoint() As List(Of Double) 'Ellipse - lower left corner

Public Property MaxPoint() As List(Of Double) 'Ellipse - upper right corner

Public Property Origin() As List(Of Double) 'Text origin

Public Property Text As String 'Text string

Public Property Start() As List(Of Double) 'Line start point

Public Property [End]() As List(Of Double) 'Line end point (must declare 'escaped' names by using brackets in VB or a leading @ in C#)

End Class

 

Caveat: This object may not be complete - use it at your own risk!

Message 4 of 4

Dear @brian.k.smith

 

This looks great and could be very useful for my concern.

 

So I've tried the following code from the following scene.

 

NWRedlines.png

 

   string redline = document.ActiveView.GetRedlines();
   System.IO.StreamWriter file = new StreamWriter("./CurrentViewPointRedline.json");
   file.Write(redline);
   file.Close();

 

I was expecting to get the paramaters of the redline annotation but unfortunately my json returned string seems to be empty 😞

 

{"Type":"RedlineCollection","Version":1,"Values":[]}

 

Any idea ?

 

Thank you very much for your help,

 

Christophe.

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

Post to forums  

Rail Community


Autodesk Design & Make Report