Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations pierreick on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Removing stickiness from NXOpen application with code from a journal

Status
Not open for further replies.

Duder58

Petroleum
Feb 6, 2014
14
I have created a VB.NET NXOpen application with a code snippet from a journal. In the application I am attempting to move a title block but the "ID" of the title block changes lets say when it is placed on Sheet 2. How can I get the identifier of the title block and substitute workPart.FindObject("HANDLE R-575156") with some type of ID that is not hard coded? Below is a code snippet I am working with.


Dim titleBlock1 As Annotations.TitleBlock = CType(workPart.FindObject("HANDLE R-575156"), Annotations.TitleBlock)

I am running NX 8.5 and using VB.NET for this project.

Thanks
 
Replies continue below

Recommended for you

You can access all of the title blocks in a part through the DraftingManager property:
Code:
workPart.DraftingManager.TitleBlocks

If you want to move all the title blocks, iterate through the collection moving each in turn. If you only want to move a certain one, you'll need some way to determine which is the correct one. Do you only want to move the title block on sheet 2, for example? If so, you'll need a way to determine which one resides on sheet 2. There is a function in the following thread that will determine which sheet a drafting object resides on (see the post dated: 13 Aug 14 15:58).

thread561-369358


www.nxjournaling.com
 
Hey thanks Cowski, that worked great for my titleblock but I now have two other objects I need a substitute for, a TableSection and a CustomSymbol. I have tried looking through the Object Browser in Visual Studio but so far have had no luck. Do you have any suggestions for these two?

Dim tableSection2 As Annotations.TableSection = CType(workPart.Annotations.TableSections.FindObject("HANDLE R-14928"), Annotations.TableSection)

Dim customSymbol1 As Annotations.CustomSymbol = CType(workPart.FindObject("HANDLE R-902617"), Annotations.CustomSymbol)

Thanks again,
 
Table sections and custom symbols each have their own collections:

Code:
{part}.Annotations.TableSectons
{part}.Annotations.CustomSymbols

www.nxjournaling.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor