Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14

Thread: UCS vs MOVE commands

  1. #11
    Member
    Join Date
    2001-03
    Location
    ROMANIA
    Posts
    35
    Login to Give a bone
    0

    Default Re: UCS vs MOVE commands

    Quote Originally Posted by marko_ribar View Post
    Well you explained that bl_name is something like sheet block, so when you insert it on some location you pick, I assumed that you want all other entities to move to be placed inside that sheet... So I thought you actually want to move all except bl_name from '(0.0 0.0 0.0) to insertion point "@" - lastpoint variable...
    Thank you marko_ribar for your interes.
    I have attached a file that I think will clarify.
    Attached Files Attached Files

  2. #12
    All AUGI, all the time
    Join Date
    2015-10
    Location
    Belgrade, Serbia, Europe
    Posts
    564
    Login to Give a bone
    0

    Default Re: UCS vs MOVE commands

    You should have posted PDF or DWG at first place... This explains everything, and yes it's quite tricky...

    Code:
    (defun TUCS ( bl_name / ucsf v )
      (if (= (getvar 'worlducs) 0)
        (progn
          (command "_.UCS" "_W")
          (setq ucsf t)
        )
      )
      (command "_.-INSERT" bl_name "\\")
      (while (< 0 (getvar 'cmdactive))
        (command "")
      )
      (setq v (mapcar '- '(0.0 0.0) (getvar 'lastpoint)))
      (command "_.MOVE" (ssget "_X") "" "_non" "@" "_non" '(0.0 0.0 0.0))
      (if ucsf
        (progn
          (command "_.UCS" "_P")
          (command "_.UCS" "_M" "_non" (trans (mapcar '+ (trans '(0.0 0.0 0.0) 1 0) v) 0 1))
        )
        (command "_.UCS" "_X" 180)
      )
      (princ)
    )
    HTH, M.R.

  3. #13
    Member
    Join Date
    2001-03
    Location
    ROMANIA
    Posts
    35
    Login to Give a bone
    0

    Default Re: UCS vs MOVE commands

    Quote Originally Posted by marko_ribar View Post
    You should have posted PDF or DWG at first place... This explains everything, and yes it's quite tricky...

    Code:
    (defun TUCS ( bl_name / ucsf v )
      (if (= (getvar 'worlducs) 0)
        (progn
          (command "_.UCS" "_W")
          (setq ucsf t)
        )
      )
      (command "_.-INSERT" bl_name "\\")
      (while (< 0 (getvar 'cmdactive))
        (command "")
      )
      (setq v (mapcar '- '(0.0 0.0) (getvar 'lastpoint)))
      (command "_.MOVE" (ssget "_X") "" "_non" "@" "_non" '(0.0 0.0 0.0))
      (if ucsf
        (progn
          (command "_.UCS" "_P")
          (command "_.UCS" "_M" "_non" (trans (mapcar '+ (trans '(0.0 0.0 0.0) 1 0) v) 0 1))
        )
        (command "_.UCS" "_X" 180)
      )
      (princ)
    )
    HTH, M.R.
    Its works only if Block insertion point = WCS origin. For this reason I switch minus sign with plus sign under MAPCAR functions. Please check yourself.

    Its seems to works as bellow, but all that I want is a way to change the bloody line (CONS 10 what???) inside ENTMAKE function (see my code, please).
    Thank you.

    Code:
    (defun TUCS (bl_name / ucsf v)
      (if (= (getvar 'worlducs) 0)
        (progn
          (command "_.UCS" "_W")
          (setq ucsf t)
        )
      )
      (command "_.-INSERT" bl_name "\\")
      (while (< 0 (getvar 'cmdactive))
        (command "")
      )
    ;;(setq v (mapcar '- '(0.0 0.0 0.0) (getvar 'lastpoint)))
      (setq v (mapcar '+ '(0.0 0.0 0.0) (getvar 'lastpoint)))
      (princ "\nv=")(princ v)
      (command "_.MOVE" (ssget "_X") "" "_non" "@" "_non" '(0.0 0.0 0.0))
      (if ucsf
        (progn
          (command "_.UCS" "_P")
    ;;	  (command "_.UCS" "_M" "_non" (trans (mapcar '+ (trans '(0.0 0.0 0.0) 1 0) v) 0 1))
    	  (command "_.UCS" "_M" "_non" (trans (mapcar '- (trans '(0.0 0.0 0.0) 1 0) v) 0 1))
        )
        (command "_.UCS" "_X" 180)
      )
      (princ)
    )

  4. #14
    All AUGI, all the time
    Join Date
    2015-10
    Location
    Belgrade, Serbia, Europe
    Posts
    564
    Login to Give a bone
    0

    Default Re: UCS vs MOVE commands

    Quote Originally Posted by LiDo View Post
    Its works only if Block insertion point = WCS origin. For this reason I switch minus sign with plus sign under MAPCAR functions. Please check yourself.

    Its seems to works as bellow, but all that I want is a way to change the bloody line (CONS 10 what???) inside ENTMAKE function (see my code, please).
    Thank you.
    Well if it works now for you, I'd stick with solution... I personally think that creating temporary UCS is somewhat wrong way, especially if its name is used sometime again in some other code and you failed to eliminate it from memory or saved DWG with it... So I strongly suggest that you avoid this kind of situations and use ordinary UCS "Previous" option whenever it's possible... Memory of stored UCS is empty and no evident reasons for possible error situations are avoided... And if you plan to use saved UCS, only then it's approving if you're to eliminate it after routine execution or through error handlers in cases the code terminates in not standard way...

Page 2 of 2 FirstFirst 12

Similar Threads

  1. 2007: Dimension issue when using commands such as COPY and MOVE
    By jstorrie in forum AutoCAD LT - General
    Replies: 1
    Last Post: 2015-09-18, 11:46 AM
  2. Option to Rotate and Move within other commands.
    By inventor.wishlist1738 in forum Inventor Wish List
    Replies: 0
    Last Post: 2010-09-21, 02:14 PM
  3. Hot Key Commands Vs Selecting Toolbar Commands.
    By matthew.113087 in forum AutoCAD General
    Replies: 10
    Last Post: 2007-06-28, 11:37 AM
  4. Replies: 0
    Last Post: 2005-03-26, 04:55 PM
  5. AutoCAD copy and move commands with Eagle Point
    By jasontirone in forum Software
    Replies: 5
    Last Post: 2004-11-08, 09:37 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •