PDA

View Full Version : How to automatically position AM views via lisp code?


fabrizio
04-11-2003, 03:05 AM
Hi all.
I have the need to automatically position the annotation views of a 3D Model via lisp program. In other words, I need to write a command that, without asking any input to the user, generates some views of a model in a position calculated by the program itself, and updates 'em, all in one click. The problem is that none of the commands that create Annotation views AM_CREATE_DWG, AM_CREATE_STANDARD, etc...) accepts also a position to place the views themselves.
The way the views are positioned is somehow different from all other OSD and AM commands because :
1- The user can't type into the command line the cohordinates of where the view should be positioned (he has to pick a point with the mouse)
2- You can't tell such position to Annotation via lisp program in the "standard" way.

Is there a way to tell to Annotation the position where a view should be placed when you use the commands AM_CREATE_DWG, AM_CREATE_STANDARD, ecc...) in a lisp program?

Thanx a lot in advance.
Fabrizio

Wolfgang
04-11-2003, 02:42 PM
A look into the integration kit index for Annotation would be very helpful.
there is:

(oli::sd-am-create-standard-view ...)
(oli::sd-am-create-section-view ...)

both available since a couple of versions. (about 2 years)

inside AM_CREATE_DWG you can use 'auto place' mechanism with 1st andd 3rd angle projection.

inside AM_CREATE_STANDARD as well as in all other view creation dialogs you can use the (hidden) keyword :position which is also available since 2 or 3 versions. You can create/place one view per call. Have a look to the online reference.

example:
(am_create_general
:direction (set_vp_direction "Aux. VP" -0.8,-0.5,0.3)
:vp_dir "Aux. VP"
:position -200,220)
(am_create_section :PARENT_VIEW "/ServoBlock/vs1/front1"
:line-twopts -171,58 -165,34 -141,39
-137,15 -120,24 -109,4
:accept
:position -50,50)

This should solve your problem completely.

fabrizio
04-14-2003, 01:29 AM
Wolfgang,
thanks a lot for your precision. Sorry, it's my fault, because I didn't check the IKit documentation accurately.
But the two functions you reported

(oli::sd-am-create-standard-view ...)
(oli::sd-am-create-section-view ...)

are not suitable to create and position a view from a 3d docuplane; and that is what I have to do at the moment in my program (sorry for not beeing enough precise in my original post... :( )



inside AM_CREATE_DWG you can use 'auto place' mechanism with 1st andd 3rd angle projection.
Neither this mechanism seems to be available for docuplane originated views...



inside AM_CREATE_STANDARD as well as in all other view creation dialogs you can use the (hidden) keyword : position
I tryed the hidden keyword : position inside the command am_transfer_docuplane (which creates an annotation view from a docuplane) but it seems to be ignored by Annotation.

Anyway, thank you a lot.

Has anyone any other suggestions/ideas?

Thanks
Fabrizio

Wolfgang
04-14-2003, 07:04 AM
well well, we have been talking about normal annotation views. Yes, am_transfer_docuplane does not support the :position keyword.

Now my ideas come to an end..