PDA

View Full Version : Find lower left corner of frame


tom kirkman
06-27-2003, 11:39 AM
I am working on a lisp routing to place a sketch at the lower left corner of an existing frame in annotation.

Is there a way of automatically finding the corner of the frame? Currently I place the sketch at 0,-.125 which works fine unless someone moved the frame, or replaced the frame with one of a different size.

Thanks

Tom Kirkman

:confused:

Jim McKim
06-27-2003, 02:19 PM
Can't help you with finding the corner of the frame, but if you can make the frame be the owner of the sketch, then at least the sketch will move with the frame if the frame gets repositioned. Disadvantage of this is that if the frame type gets changed, then you'll lose the sketch (unless the ownership gets temporarily changed to something else while the frame type is being changed).

tom kirkman
07-02-2003, 07:48 AM
Thanks to cocreate support, here's how it is done. (This is the command as it has been added to the user_avail_cmds.cmd file)

cancel_all

(setq Upn (oli::sd-am-inq-unique-name (oli::sd-am-sheet-struct-frame

(oli::sd-am-inq-sheet (oli::sd-am-inq-curr-sheet)))))

;;(display (format nil "Upn: ~S" Upn))

(setq box (docu-fnc (format nil "Docu_get_part_box '~A'" Upn)))

;;(display(format nil "box: ~S" box))

(setq x-ll (read-from-string (first (getf box :ll))))

;; (display (format nil "x-ll: ~S" x-ll))

(setq y-ll (read-from-string (second (getf box :ll))))

;;(display (format nil "y-ll: ~S" y-ll))

(setq your-pick-point (read-from-string (format nil "~a,~a" (+ x-ll 5.5) (- y-ll 1.625))))

cancel

am_load_sketch :owner am_geo_set_domain :prompt-var "VIEW" :current-sheet "Act Sheet" :go :ok :display-options :object "Change Card" :cursor_adjustment :off your-pick-point cancel

am_text_reference :tr_group "Sheet_global" :tr_update complete

Michael Kahle
07-03-2003, 10:51 PM
For 12.0 the I-Kit function (SD-AM-INQ-SHEET) will also return the corners of the corresponding frame.