Quantcast
Channel: NX Journaling - Journaling / NXOpen API
Viewing all articles
Browse latest Browse all 783

Extracting Title Block Information

$
0
0

Hello Again,

I'm slowly crawling towards the end of my first Journal. I have with your help managed to get a bit of code to locate the two tables I am interested in. Extracting the information from them is the next step, which I already have some start in.

That being said, I have stumbled upon a new problem. We use a template to start a drawing, so I thought the title block would be stored in the same location each time. So I made a journal and tried to just copy that location over. Here is the code.

Sub FindTitleBlockInformation(ByRef tagList As List(OfString)) 
		'--------------------------------------' Finds the title bocks in the sessions'-------------------------------------- 
		Dim titleblocks1(3)As Annotations.TitleBlockDim titleBlock1 As Annotations.TitleBlock=CType(workPart.FindObject("HANDLE R-147862"), Annotations.TitleBlock) 
		titleblocks1(0)= titleBlock1
		Dim titleBlock2 As Annotations.TitleBlock=CType(workPart.FindObject("HANDLE R-169015"), Annotations.TitleBlock) 
		titleblocks1(1)= titleBlock2
		Dim titleBlock3 As Annotations.TitleBlock=CType(workPart.FindObject("HANDLE R-197476"), Annotations.TitleBlock) 
		titleblocks1(2)= titleBlock3
		Dim titleBlock4 As Annotations.TitleBlock=CType(workPart.FindObject("HANDLE R-393572"), Annotations.TitleBlock) 
		titleblocks1(3)= titleBlock4
		Dim editTitleBlockBuilder1 As Annotations.EditTitleBlockBuilder
		editTitleBlockBuilder1 = workPart.DraftingManager.TitleBlocks.CreateEditTitleBlockBuilder(titleblocks1) 
		Dim titleBlockCellBuilderList1 As Annotations.TitleBlockCellBuilderList
		titleBlockCellBuilderList1 = editTitleBlockBuilder1.Cells 
		'--------------------------------------' Finds the cells in the title blocks''-------------------------------------- 
		Dim taggedObject1 As TaggedObject
		taggedObject1 = titleBlockCellBuilderList1.FindItem(0) 
		Dim titleBlockCellBuilder1 As Annotations.TitleBlockCellBuilder=CType(taggedObject1, Annotations.TitleBlockCellBuilder) 
		Dim taggedObject2 As TaggedObject
		taggedObject2 = titleBlockCellBuilderList1.FindItem(1) 
		Dim titleBlockCellBuilder2 As Annotations.TitleBlockCellBuilder=CType(taggedObject2, Annotations.TitleBlockCellBuilder) 
		Dim taggedObject3 As TaggedObject
		taggedObject3 = titleBlockCellBuilderList1.FindItem(10) 
		Dim titleBlockCellBuilder3 As Annotations.TitleBlockCellBuilder=CType(taggedObject3, Annotations.TitleBlockCellBuilder) 
		Dim PIN Asstring
		PIN = titleBlockCellBuilder1.EditableText 
		Dim INITIALS Asstring
		INITIALS = titleBlockCellBuilder2.EditableText 
		Dim ImplantName Asstring
		ImplantName = titleBlockCellBuilder3.EditableText 
		tagList.Add(PIN)
		tagList.Add(INITIALS)
		tagList.Add(ImplantName) 
	EndSub

But I then ran it in another drawing to test to make sure it would follow through, and as you can guess, it did not. So my question is, how do I access the information from the populate title block tool reliably? I know it will have the same structure each time (I.E the same 11 items in the same order) There will be multiple sheets with the same information possibly presented in a different format for the table, but still present. Any ideas? I'm going to go back to the docs to see if I'm missing something glaringly obvious.


Viewing all articles
Browse latest Browse all 783

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>