Thursday, February 9, 2012

Align PS to MS

I found this tid bit online on a forum, it doesn't work with Intellicad, but I am sure some Intellicad guru can re-write it

(defun c:alignps ( / )
(setvar "cmdecho" 0)
(setq oldexpert (getvar "expert"))
(setvar "expert" 4)
(setq pms (getpoint "\nPoint in MS: "))
(command "_pspace")
(setq pps (getpoint "\nPoint in PS: "))
(command "_mspace")
(setq pms2 (trans pps 1 0))
(setq pms2 (trans (trans pms2 3 2) 2 1))
(command "_pan" pms pms2)
(setvar "expert" oldexpert)
)

1 comment:

  1. Steve, I don't think Intellicad has a properly working TRANS function yet.

    The problem is probably here:
    (trans pms2 3 2)
    where you are trying to transform the paper space coordinate to the DCS coordinate of the viewport.

    I could be wrong and have not tested it out but that is where I would start...

    ReplyDelete

Note: Only a member of this blog may post a comment.