CoCreate User Forum  

Go Back   CoCreate User Forum > Support > Customization

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 04-03-2023, 06:33 AM
ssusana ssusana is offline
Registered User
 
Join Date: Aug 2004
Location: Italy
Posts: 60
inquire position and box dimension in Annotation

Hello,
i have a question, how i can inquire the box dimension and his coordinate of an element in Annotation using selection by S_DOCU_PART?

thank you
Attached Thumbnails
Click image for larger version

Name:	Immagine 2023-04-03 162827.png
Views:	128
Size:	19.0 KB
ID:	2026  
Reply With Quote
  #2  
Old 04-04-2023, 09:52 AM
Wolfgang's Avatar
Wolfgang Wolfgang is offline
Registered User
 
Join Date: Nov 2002
Location: ... near Sindelfingen near Stuttgart, Germany
Posts: 754
Arrow Re: inquire position and box dimension in Annotation

Quote:
Originally Posted by ssusana View Post
inquire the box dimension and its coordinate of an element ... using selection by S_DOCU_PART?
I read your question that you do have a S_DOCU_PART and want to get the values of this (ME10)PART.

Many macros are available as source code in the directory <ModelingInstDir>/Annotation/win. Look for all the lines with "DEFINE " in *.m files.

There are basically 2 macros of interest
Code:
DEFINE Docu_get_part_box
and
Code:
DEFINE Docu_inq_part_box_coords
Both take a UPN as parameter (the unique part number of an ME10 Part) and do return a LISP property list. The UPN you can get with the documented IKIT function (sd-am-inq-unique-name item). This works for sketches and symbols as well.

Having that, you can call a function
Code:
(display (sd-execute-annotator-function :fnc 
           (format nil "Docu_inq_part_box_coords '~A' "
              (sd-am-inq-unique-name the-sel-item))))
Note the different use of double quotes and single quotes in these Lisp sequences, when communicating directly with Annotator.exe.

If you are trying this on Modeling command line use (oli::sd-... instead of (sd-...

__________________________________________


Inquiring the dimension of an element (e.g. an arc, a dimension) is much more complex.
Reply With Quote
  #3  
Old 04-04-2023, 09:38 PM
ssusana ssusana is offline
Registered User
 
Join Date: Aug 2004
Location: Italy
Posts: 60
Re: inquire position and box dimension in Annotation

thank you very much Wolfgang,
the next days I develop my idea and send the result.
Reply With Quote
  #4  
Old 04-16-2023, 11:57 AM
ssusana ssusana is offline
Registered User
 
Join Date: Aug 2004
Location: Italy
Posts: 60
Re: inquire position and box dimension in Annotation

another question,
I want inquire the UPN via path, is it possible?
I set DOCU::*DOCU-BROWSER-DISPLAY-ALL* value T, now I can see the 3D structure in Annotation (see image atthacment), single clic print the patrhname in console windows and double clic print the UPN number.

Exist a function to inquire che UPN using in input the Pathname object?

I found a funtion in .m file in <ModelingInstDir>/Annotation/win but I failure.

thank you for your helps.

Stefano S.
Attached Thumbnails
Click image for larger version

Name:	Annotation.png
Views:	123
Size:	46.6 KB
ID:	2027  
Reply With Quote
  #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
  #6  
Old 04-17-2023, 11:19 AM
ssusana ssusana is offline
Registered User
 
Join Date: Aug 2004
Location: Italy
Posts: 60
Red face Re: inquire position and box dimension in Annotation

thank you Wolfgang for your advise, I will change my strategy.
I need to study the integration kit more and more.
Reply With Quote
  #7  
Old 05-08-2023, 06:46 AM
tom kirkman's Avatar
tom kirkman tom kirkman is offline
Registered User
 
Join Date: Oct 2002
Location: Perrysburg, Ohio
Posts: 397
Re: inquire position and box dimension in Annotation

If you are not an expert in LISP, there is a book that is fun and educational called "Land of Lisp". It walks you through the basics and you build a game while doing it.

http://landoflisp.com/
__________________
Tom Kirkman

Creo Elements/Direct 20.1
Dell Precision 3581
https://www.o-i.com
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 02:40 AM.



Hosted by SureServer    Forums   Modeling FAQ   Macro Site   Vendor/Contractors   Software Resellers   CoCreate   Gallery   Home   Board Members   Regional User Groups  By-Laws  

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.