Author Topic: UCS move with object. Thinking out loud.  (Read 661 times)

0 Members and 1 Guest are viewing this topic.

jlogan02

  • Bull Frog
  • Posts: 327
UCS move with object. Thinking out loud.
« 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.


J. Logan
ACAD 2018

I am one with the Force and the Force is with me.
AutoCAD Map 2018 Windows 10

danAllen

  • Newt
  • Posts: 132
Re: UCS move with object. Thinking out loud.
« Reply #1 on: February 23, 2023, 07:48:50 PM »
why not use command UCS > entity ?

BIGAL

  • Swamp Rat
  • Posts: 1398
  • 40 + years of using Autocad
Re: UCS move with object. Thinking out loud.
« Reply #2 on: February 24, 2023, 09:40:54 PM »
Same answer UCS OB
A man who never made a mistake never made anything