+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Forum Newbie
    Discipline
    Mechanical
    Using
    AutoCAD 2015
    Join Date
    Feb 2017
    Posts
    7

    Default Working Point Lisp, skips a line and I can't figure out why

    Registered forum members do not see this ad.

    Hello,

    I have more or less completed this little lisp and I can't figure out why it is skipping the first line after my 'if' statement.

    Basically, when you're in paperspace, it'll put your cursor into modelspace and you pick the point you want to annotate with a working point. For some reason my lisp won't go into modelspace.

    Code:
    ;; This lisp creates a working point leader in paperspace
    ;; known bugs: the current selected multileader type will be the style of the working point
    ;; Rev 1 2017-03-02
    ;; Created by J. Therrien
    
    (defun c:WorkingPoint (/ WorkingPoint Easting Northing Point PSPACEPOINT PSPACE TEXT TEXTPROPS COORD NorthingWP EastingWp)
      (if (and (= (getvar "TILEMODE") 0) (= (getvar "CVPORT") 1))
        (;;then
         (command
           "_.mspace"
           );;end command
          (setq WorkingPoint (getpoint "\nWhere is Working Point?: "))
          (setq Northing (rtos (cadr WorkingPoint) 2 1));;set "y" value of WorkingPoint to Northing
          (setq Easting (rtos (car WorkingPoint) 2 1));;set "x" value of WorkingPoint to Easting
          (setq NorthingWP (strcat "N: " Northing));; creates the proper formatting for the leader
          (setq EastingWP (strcat "E: " Easting));; creates the proper formatting for the leader
          (command "_.point" WorkingPoint);;end command
          (setq point (entlast));;set the workingpoint to point
          (command "_.chspace" point "" "");;this brings the workingpoint set in the modelspace to paperspace
          (setq pspacepoint (entget point));;get the properties for point
          (setq pspace (cdr (assoc 10 pspacepoint)));;find the x&y coords and set to pspace
          (setq anotbp (getpoint "\nSpecify leader basepoint: "))
          (COMMAND
    	"mTEXT" PSPACE "@30,-30" "WORKING POINT" NORTHINGWP EASTINGWP ""
    	);;end command
          (setq text (entlast));;set mtext to variable text
          (setq textprops (entget text));;get the properties from text
          (setq coord (cdr (assoc 1 textprops)));;find the string properties and set to coord
          (command
    	"_.mleader" pspace anotbp coord
    	"_.erase" point text ""
    	);;END COMMAND
          );;end then
        (alert "Make sure you are in paperspace to use this command");;else
        );;end if
      );;end defun

  2. #2
    Super Member
    Using
    not applicable
    Join Date
    Jun 2016
    Posts
    590

    Default

    Use progn.
    BricsCAD 18

  3. #3
    Forum Newbie
    Discipline
    Mechanical
    Using
    AutoCAD 2015
    Join Date
    Feb 2017
    Posts
    7

    Default

    Registered forum members do not see this ad.

    wow... that was dumb on my part, thanks!

Similar Threads

  1. line new layer my lisp not working please fix
    By sanjeeve in forum AutoLISP, Visual LISP & DCL
    Replies: 22
    Last Post: 1st Nov 2014, 02:05 am
  2. Working Point Lisp
    By chiimayred in forum AutoLISP, Visual LISP & DCL
    Replies: 5
    Last Post: 31st Oct 2014, 03:22 pm
  3. Easy question (I think)... just can't figure it out... making a line longer
    By EnvisionMan in forum Autodesk Software General
    Replies: 3
    Last Post: 3rd Jun 2012, 10:51 pm
  4. Hidden Line Can't Figure it Out
    By apache73 in forum AutoCAD Beginners' Area
    Replies: 3
    Last Post: 11th Oct 2006, 10:51 pm

Tags for this Thread

Bookmarks

Posting Permissions

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