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

Find Object Problem

I Want to make a VB program to read data from Title Block and write it in the information window.

First I made a Journal and then I edited it so that it works on all my drawings. But I couldn't solve the "Find Object" problem. I don't know how to call my title block in my drawing. I don't want to select the title block while journal is running.

Sina shojaee
4 REPLIES

Re: Find Object Problem

Find object will only work if the object always has the same name, which is seldom the case.

 

FindObject is meant to be only used in recorded journals not in general source code, which is mentioned in the documentation of that method.

 

You need to go through the TitleBlockCollection to find the correct title block in general code.

Stefan Pendl, Systemmanager CAx, HAIDLMAIR GmbH
Production: NX10.0.3, VERICUT 8.0, FBM, MRL 3.1.4 | TcUA 10.1 MP7 Patch 0 (10.1.7.0) | TcVis 10.1
Development: VB.NET, Tcl/Tk    Testing: NX11.0 EAP, NX12.0 EAP

How to Get the Most from Your Signature in the Community
Solution
Solution
Accepted by topic author sina
‎08-26-2015 04:32 AM

Re: Find Object Problem

Sina,

 

Good afternoon.  Here is a small example to show how you can get the TitleBlock object on the current drawing sheet.  I will add this to the GTAC examples on the Solution Center.  I hope this helps!

 

Regards,

 

Steve

 

Re: Find Object Problem

Thank you Steve

This is exactly what I want. It Works really good. But there is an error while running it.

thisTB is not declared. So it was no problem. Thank you again

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

Re: Find Object Problem

For Each thisTB In allTBs

Sorry about that - please change the line above to this in order to specify what thisTB is:

 

For Each thisTB As TitleBlock In allTBs