CoCreate User Forum

CoCreate User Forum (https://www.cocreateusers.org/forum/index.php)
-   Customization (https://www.cocreateusers.org/forum/forumdisplay.php?f=12)
-   -   inquire position and box dimension in Annotation (https://www.cocreateusers.org/forum/showthread.php?t=8369)

ssusana 04-03-2023 06:33 AM

inquire position and box dimension in Annotation
 
1 Attachment(s)
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

Wolfgang 04-04-2023 09:52 AM

Re: inquire position and box dimension in Annotation
 
Quote:

Originally Posted by ssusana (Post 26308)
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.

ssusana 04-04-2023 09:38 PM

Re: inquire position and box dimension in Annotation
 
thank you very much Wolfgang,
the next days I develop my idea and send the result.

ssusana 04-16-2023 11:57 AM

Re: inquire position and box dimension in Annotation
 
1 Attachment(s)
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.

Wolfgang 04-17-2023 08:05 AM

Re: inquire position and box dimension in Annotation
 
Quote:

Originally Posted by ssusana (Post 26312)
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.

ssusana 04-17-2023 11:19 AM

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.

tom kirkman 05-08-2023 06:46 AM

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/


All times are GMT -8. The time now is 08:51 PM.

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