Differentiating hidden DVlines from the DVlines collection

Creator
Creator

I'm using a code for getting hidden DVlines from the collection of DVlines. I'm using an API called getsegmentedstyle() for the same but it is throwing an error while I'm trying to execute this function.

 My code is shown Below:-

 

Dim Index As Integer = 1

Dim x1 As Double = Nothing
Dim y1 As Double = Nothing
Dim x2 As Double = Nothing

Dim y2 As Double = Nothing
Dim Style As Object = Nothing

dvline2d1.GetSegmentedStyle(Index, x1, y1, x2, y2, Style)

when the above is executed it is throwing an error.

Please can some one walk me through this issue.

The error code is attached below.

4 REPLIES

Re: Differentiating hidden DVlines from the DVlines collection

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

Hi Admin2,

I copied your code in a test project and it worked!

 

Has dvline2d1 a valid Line object value? Set a breakpoint and look an the value in VS.

 

Two other remarks:

 * No need to assign Nothing to a Double variable

 * A Line can have more than 1 LinearStyle (partially hidden line), so use the "SegmentedStyleCount" property to get the count and iterate from 1 to count.

regards

JB
VS2015, SE ST10

Re: Differentiating hidden DVlines from the DVlines collection

Creator
Creator

Hi JB,

 

Thank you for your reply. But in my program, when I'm calling the function getsegmented style(), it is throwing the error. I edited my code according to your remarks and it is still throwing error.Can anyone please suggest an alternative solution to filter off invisible lines from dvlines collection.

 

With Regards

Admin2

Solid Edge ST9

VS 2010 Pro

 

Re: Differentiating hidden DVlines from the DVlines collection

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

Hi Admin2,

to avoid missunderstanding: your code executes in my enviroment without changes.

If the call of the method thows an error you should check the Line object  (debugger) and the used SE Interop library.

regards

JB
VS2015, SE ST10

Re: Differentiating hidden DVlines from the DVlines collection

Creator
Creator

Hi JB,

 

This issue was solved and the error was being thrown because showhiddenedgesbyotherparts property in the drawing view was kept false. Anyway thank you for your support.

 

Thank you