Showing results for 
Search instead for 
Do you mean 
Reply
Solved! Go to solution

Edit Section line Settings

I made a NX Open program to edit section lines settings in my drawings but it didn't work.

I know that my code can't find section lines but I don't know how to correct it.

Sina shojaee
3 REPLIES
Solution
Solution
Accepted by topic author sina
‎08-26-2015 04:32 AM

Re: Edit Section line Settings

The section lines have their own collection, you won't find them in the .Sections collection.

 

Try the following:

For Each temp As Drawings.SectionLine In workPart.Drafting.SectionLines

Re: Edit Section line Settings

Thank you. It really works..

But I don't know how did you know that I should use "Draftings" in my code. Because I didn't find it in NX Open .Net API Reference

Sina shojaee
Solution
Solution
Accepted by topic author sina
‎08-26-2015 04:32 AM

Re: Edit Section line Settings

Since you wanted to work with section lines, I opened the .net API reference, clicked on the "index" tab and typed "Section line". In the list of topics I found the "SectionLine" class and the "SectionLineCollection" class. To change all of the section lines you will need to iterate over the section line collection; at the bottom of that page there is a link that says "use DraftingManager.SectionLines to get an instance of this class". I followed links to the "DraftingManager" class, at the bottom of that page it says "to obtain an instance of this class, refer to Part". Here's where it gets a bit tricky. The Part class has a property named "DraftingManager", but that gives you a reference to a "DraftingApplicationManager" object, not a "DraftingManager" object. The description for the "Drafting" property says that it returns a "DraftingManager" object; following the link for the "Drafting" property shows that it will give you access to the "SectionLines" collection.

 

Alternatively, if you are using an IDE (I'm currently using the VB.net express IDE), you can use the "object browser" to search for the .SectionLines collection to find the object hierarchy necessary to get access to the .SectionLines collection.