×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

update titleblock on second sheet and above

update titleblock on second sheet and above

update titleblock on second sheet and above

(OP)
Hello everyone,

I have some problem with titleblock. Everything works great, when drawing has only one sheet. When I add more (by file import part, I have macro to do that), the cells on the second sheet looks similar to this: [REMARKS] or [DESIGNED BY], [ORDER] etc. Then I have to manually go to that sheet and then click populate title block, next put enter on each cell. After that everything looks the same like on first sheet. Next thing is, that I need use this drawing in next order, so I have journal to change values on each model in assembly to new ones. But on drawing which has more than one sheet, stays values from previous order. I think, there is some error in nx code.

That's why I record some journal to update this for me. I have title blocks for few company's we work, so the cells are different for each company. The best way will be, if journal will be the same for all, but I think it's not possible. Bellow is some code I created (now its only for one cell).

CODE

Option Strict Off

Imports System
Imports NXOpen

Module NXJournal

Sub Main (ByVal args() As String) 

	Dim theSession As NXOpen.Session = NXOpen.Session.GetSession()
	Dim workPart As NXOpen.Part = theSession.Parts.Work
	Dim displayPart As NXOpen.Part = theSession.Parts.Display
	Dim lw As ListingWindow = theSession.ListingWindow

	lw.Open()

	Dim markId1 As NXOpen.Session.UndoMarkId
	markId1 = theSession.SetUndoMark(NXOpen.Session.MarkVisibility.Visible, "Start")

	Dim titleblocks1(1) As NXOpen.Annotations.TitleBlock

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

	titleblocks1(0) = titleBlock1

	Dim titleBlock2 As NXOpen.Annotations.TitleBlock = CType(workPart.FindObject("HANDLE R-1289660"), NXOpen.Annotations.TitleBlock)

	titleblocks1(1) = titleBlock2
	Dim editTitleBlockBuilder1 As NXOpen.Annotations.EditTitleBlockBuilder
	editTitleBlockBuilder1 = workPart.DraftingManager.TitleBlocks.CreateEditTitleBlockBuilder(titleblocks1)

	Dim titleBlockCellBuilderList1 As NXOpen.Annotations.TitleBlockCellBuilderList
	titleBlockCellBuilderList1 = editTitleBlockBuilder1.Cells

	theSession.SetUndoMarkName(markId1, "Populate Title Block Dialog")

	Dim markId4 As NXOpen.Session.UndoMarkId
	markId4 = theSession.SetUndoMark(NXOpen.Session.MarkVisibility.Invisible, "Populate Title Block")

	dim text(14) as string

	text(0) = editTitleBlockBuilder1.getCellValueForLabel("REMARKS")
	text(0) = editTitleBlockBuilder1.setCellValueForLabel("REMARKS", text(0))

	lw.close
end sub

End module 

First thing I would like to change is the declaration of title block, because now it will work only in this example:

CODE

Dim titleBlock1 As NXOpen.Annotations.TitleBlock = CType(workPart.FindObject("HANDLE R-1251327"), NXOpen.Annotations.TitleBlock)
titleblocks1(0) = titleBlock1
Dim titleBlock2 As NXOpen.Annotations.TitleBlock = CType(workPart.FindObject("HANDLE R-1289660"), NXOpen.Annotations.TitleBlock)
titleblocks1(1) = titleBlock2 


second thing is to list all cell labels in title block, so I don't have to place them manually.
Any one can help me to solve this?

With best regards
Michael

RE: update titleblock on second sheet and above

I suggest you to use attributes to fill the cells.
You can use your macro to change de attributes instead of the cells.

Gelson Z. Nicoletto
Eng. Supervisor
Mould Desing
Brazil

RE: update titleblock on second sheet and above

(OP)
Hello,

But attributes are ok, the problem is only when I add another sheet to drawing, so NX doesn't see values from first sheet (master model). I will also check Your solution.

With best regards
Michael

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources