TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: jlogan02 on February 23, 2023, 06:53:12 PM

Title: UCS move with object. Thinking out loud.
Post by: jlogan02 on February 23, 2023, 06:53:12 PM
Let's say you have a saved named view after creating a new UCS at a the corner of a piece of sheet metal. Could you create a routine (I think it just popped into my head) where the UCS would, for lack of a better term, stick to the corner of the sheet metal as you moved the two lines that make up that corner of the sheet metal.

My thought is...
A move command that asks the user to select all objects to move
After the move is completed the user is prompted to pick the new location for the UCS...
Code - Auto/Visual Lisp: [Select]
  1.    (if
  2.         (and
  3.             (setq ent (car (entsel "\nSelect Line: ")))
  4.             (= "LINE" (cdr (assoc 0 (setq enx (entget ent)))))
  5.         )
  6.         (command
  7.             "_.ucs"
  8.             "_non"  
  9.             (trans (cdr (assoc 10 enx)) 0 1)
  10.             "_non"
  11.             (trans (cdr (assoc 11 enx)) 0 1)
  12.             "\\" ;; Pause for user input
  13.         ) ;; end COMMAND
  14.     ) ;; end IF


A new named view is saved.
Old named view is deleted.

This is more manual than my question about a sticky UCS I think it's doable.


Title: Re: UCS move with object. Thinking out loud.
Post by: danAllen on February 23, 2023, 07:48:50 PM
why not use command UCS > entity ?
Title: Re: UCS move with object. Thinking out loud.
Post by: BIGAL on February 24, 2023, 09:40:54 PM
Same answer UCS OB