View Single Post
  #5  
Old 04-17-2023, 08:05 AM
Wolfgang's Avatar
Wolfgang Wolfgang is offline
Registered User
 
Join Date: Nov 2002
Location: ... near Sindelfingen near Stuttgart, Germany
Posts: 754
Lightbulb Re: inquire position and box dimension in Annotation

Quote:
Originally Posted by ssusana View Post
another question,
I want inquire the UPN via path, is it possible?
Don't do so!

What you have described is not a double click/single click behaviour . It is the behaviour of clicking on the NAME in the drawing browser or clicking on the ICON in the drawing browser. When you click on the icon, the window is fitted to that object using the UPID. I added this years ago.

BUT. The 2D pathname and 2D UPID information is already part of the drawing browser's internal information. Some of this is hidden from the end user. All the data is requested in one call for the whole tree displayed in the drawing browser (e.g. if you have X sheets with each YZ views, sketch symbols and so on).

Therefore, the Drawing Browser has both in hand and uses them for 'click on name' and 'click on icon'.

BUT . this 2D path name is not unique in the tree (unlike a 3D path name in Modellng).
  1. create a sheet.
  2. create a new sketch,owned by the sheet and named "Sketch042"
  3. create a new sketch,owned by the sheet and named "Sketch042", same name!
  4. create a new sketch,owned by the sheet and named "Sketch042", same name again!

Now you will have 3 object with identical pathname but with uniqe UPIDs.

Code:
NIL(docu::docu-vp-fit-to-part "/~12")
(docu::docu-vp-fit-to-part "/~13")
(docu::docu-vp-fit-to-part "/~17")
"1/Sketch042"
"1/Sketch042"
"1/Sketch042"
There is no guaranteed PID for a given 2D pathname. If you try to query the data of such an object using the object name, ME10.exe / Annotator.exe will complain "Sketch042 is not unique" and your source code will be "lost in space".

Don't use 2D Pathname. - just my recommendation.
Reply With Quote