Results 1 to 13 of 13

Thread: Stumped by Simple Leader command

  1. #1
    Don Reichle Guest

    Stumped by Simple Leader command

    Happy Holidays to all;

    I am stumped by a "Invalid Input" for my OMON setting in the following code:

    [Lisp Code]
    (defun c:DonR08dimStdldr (/ omon)
    (setq omon (setvar "orthomode" 1)) ;set orthomode on

    (DonRdimStd08)
    (setq DonRosm (getvar "osmode"))
    (setq DonRorm (getvar "orthomode"))
    (if (not DonRal) (command "-layer" "t" "C-TEXT-DIMS" "on" "C-TEXT-DIMS"
    "m" "C-TEXT-DIMS" "c" "2" "C-TEXT-DIMS" ""))
    ;set OSNAP and ORTHOMODE to NONE
    (command "osmode" "0")
    (command "orthomode" "0")
    (command "leader" pause pause omon pause "" "" "N")

    (setvar "cmdecho" 1)

    ;return ucs to world
    (setvar "cmdecho" 0)
    (DonRucsw)
    ;set OSNAP and ORTHOMODE to previous setting
    (setvar "osmode" DonRosm)
    (setvar "orthomode" DonRorm)
    (princ)
    )
    [Lisp Code]

    I am attempting to draw the first two points of a three point leader with
    ORTHOMODE off, set ORTHOMODE on for the last point, and then return
    ORTHOMODE to its previous setting prior to starting the Leader command. In
    running the above code the first two points are set properly, then I receive
    the "Invalid Input", set the last point and the command finishes. My interim
    WA is to reach up and hit F8 prior to setting the last point.

    [Command History]
    Command: (if (not c:DonRdimStd08) (load "DonRdimStd08.lsp"))
    C:DONR08DIMSTDLDR

    Command: DonR08dimStdldr
    Dimension style is STANDARD.
    Invalid Input.
    <Ortho on> Verifying UCS set to WORLD.

    [Command History]

    Any help would be greatly appreciated.

    --
    Don Reichle
    "King Of Work-Arounds"
    Barghausen Consulting Engineers
    Kent, WA USA
    LDT3 - SP1/CD3 - SP1
    On WIN2K SP4
    Dell 1.6 Ghz P4
    512MB RAM
    NVIDIA 32MB AGP

  2. #2
    T.Willey Guest
    omon is set to 1. It is assuming that omon is a point, but it is only a value of 1. One thing you could do is just get the points then pass all three points to the leader command.

    Tim

  3. #3
    Don Reichle Guest
    Thanks for the suggestion, but I'm attempting to place the leader WRT other
    entities on screen, so I want to be able to watch the relationship between
    these entities as I draw the leader. Placing three points on screen without
    the linework accompanying them kind of defeats that purpose.

    Example;
    A rectangle representing a site in a vicinity map, and the text indicating
    the rectangle is the site. The rectangle and the text are placed prior to
    the leader.

    I realize I can place the text with the leader, by using Qleader, but some
    of the folks using this may not follow that process. Some here are more
    comfortable with shall we say, "Legacy" methodology.

    --
    Don Reichle
    "King Of Work-Arounds"
    Barghausen Consulting Engineers
    Kent, WA USA
    LDT3 - SP1/CD3 - SP1
    On WIN2K SP4
    Dell 1.6 Ghz P4
    512MB RAM
    NVIDIA 32MB AGP


    "T.Willey" <nospam@address.withheld> wrote in message
    news:5230537.1103827478228.JavaMail.jive@jiveforum 1.autodesk.com...
    omon is set to 1. It is assuming that omon is a point, but it is only a
    value of 1. One thing you could do is just get the points then pass all
    three points to the leader command.
    Tim

  4. #4
    Don Reichle Guest
    And further explanation may be useful.

    What I'm really looking for is a way to use 'ORTHOMODE - the transparent
    form while in the middle of the Leader command.

    This works during a normal step-through during the Leader command, but Lisp
    won't have anything to do with it, without the correct code.

    --
    Don Reichle
    "King Of Work-Arounds"
    Barghausen Consulting Engineers
    Kent, WA USA
    LDT3 - SP1/CD3 - SP1
    On WIN2K SP4
    Dell 1.6 Ghz P4
    512MB RAM
    NVIDIA 32MB AGP


    "T.Willey" <nospam@address.withheld> wrote in message
    news:5230537.1103827478228.JavaMail.jive@jiveforum 1.autodesk.com...
    omon is set to 1. It is assuming that omon is a point, but it is only a
    value of 1. One thing you could do is just get the points then pass all
    three points to the leader command.
    Tim

  5. #5
    Allen Johnson Guest
    (command "leader" pause pause )(setvar "orthomode" 1)(command pause "" ""
    "N")

  6. #6
    T.Willey Guest
    You can see the line drawin between points as you draw the points

    (setvar "orthomode" 0)
    (setq pt1 (getpoint "\n Select point: "))
    (setq pt2 (getpoint pt1"\n Select point: "))
    (setvar "orthomode" 1)
    (setq pt3 (getpoint pt2"\n Select point: "))

    Tim

  7. #7
    GaryDF Guest
    Here is what I use, maybe it will help:

    Gary

    (defun ALDR_SET (/ ldrname)
    (cond
    ((>= (atoi (substr (getvar "acadver") 1 2)) 15)
    (progn
    (setvar "CMDECHO" 0)
    (setvar "DIMCLRT" 2)
    (setvar "DIMCLRD" 1)
    ;;(setvar "DIMBLK" ".")
    ;;(setvar "DIMBLK1" ".")
    ;;(setvar "DIMBLK2" ".")
    (setvar "DIMLDRBLK" ".")
    ;;(setvar "DIMLDRBLK" "")
    (cond
    ((= ARCH#UNIT "Ci")
    (setvar "DIMASZ" 0.2)
    ) ;Arrow size
    ((= ARCH#UNIT "Mm")
    (setvar "DIMASZ" 5.08)
    ) ;Arrow size
    ((= ARCH#UNIT "Cm")
    (setvar "DIMASZ" 0.508)
    ) ;Arrow size
    ((= ARCH#UNIT "Ar")
    (setvar "DIMASZ" 0.2)
    ) ;Arrow size
    ((= ARCH#UNIT "Me")
    (setvar "DIMASZ" 0.00508)
    ) ;Arrow size
    ((= ARCH#UNIT "En")
    (setvar "DIMASZ" 0.2)
    ) ;Arrow size
    )
    (setq DIMNAME (rtos (getvar "dimscale") 2 0))
    (setq ldrname (strcat "LDR-" DIMNAME))
    (cond
    ((/= (cdr (assoc 2 (tblsearch "dimstyle" ldrname))) ldrname)
    (command "dimstyle" "S" ldrname)
    )
    ((= (cdr (assoc 2 (tblsearch "dimstyle" ldrname))) ldrname)
    (command "dimstyle" "R" ldrname)
    )
    )
    )
    )
    )
    (princ)
    )

    (defun LEADER_SETTER (/ pt1 pt2 pt3)
    (setvar "CMDECHO" 0)
    (setvar "orthomode" 0)
    (setvar "osmode" 0)
    (setq pt1 (getpoint "\n* Specify leader start point *"))
    (setvar "osmode" 512)
    (setq pt2 (getpoint pt1 "\n* Specify leader break point *"))
    (setvar "orthomode" 1)
    (setq pt3 (getpoint pt2 "\n* To point *"))
    (command ".leader" pt1 pt2 pt3 "A" "" "N" "")
    (setvar "CMDECHO" 1)
    (princ)
    )

    (defun c:ALDR ()
    ;;(ARCH:F_S-VAR) ;save vars
    ;;(ARCH:CUSTOM_LAYERS-ANNO) ;create layer
    ;;(ALDR_SET) ;set leader style
    (LEADER_SETTER)
    ;;(ARCH:F_R-VAR) ;restore vars
    (princ "\n* Leader completed *")
    (princ)
    )

    "Don Reichle" <dreichle@barghausen.com> wrote in message
    news:41cb0da9_2@newsprd01...
    Happy Holidays to all;

    I am stumped by a "Invalid Input" for my OMON setting in the following code:

    [Lisp Code]
    (defun c:DonR08dimStdldr (/ omon)
    (setq omon (setvar "orthomode" 1)) ;set orthomode on

    (DonRdimStd08)
    (setq DonRosm (getvar "osmode"))
    (setq DonRorm (getvar "orthomode"))
    (if (not DonRal) (command "-layer" "t" "C-TEXT-DIMS" "on" "C-TEXT-DIMS"
    "m" "C-TEXT-DIMS" "c" "2" "C-TEXT-DIMS" ""))
    ;set OSNAP and ORTHOMODE to NONE
    (command "osmode" "0")
    (command "orthomode" "0")
    (command "leader" pause pause omon pause "" "" "N")

    (setvar "cmdecho" 1)

    ;return ucs to world
    (setvar "cmdecho" 0)
    (DonRucsw)
    ;set OSNAP and ORTHOMODE to previous setting
    (setvar "osmode" DonRosm)
    (setvar "orthomode" DonRorm)
    (princ)
    )
    [Lisp Code]

    I am attempting to draw the first two points of a three point leader with
    ORTHOMODE off, set ORTHOMODE on for the last point, and then return
    ORTHOMODE to its previous setting prior to starting the Leader command. In
    running the above code the first two points are set properly, then I receive
    the "Invalid Input", set the last point and the command finishes. My interim
    WA is to reach up and hit F8 prior to setting the last point.

    [Command History]
    Command: (if (not c:DonRdimStd08) (load "DonRdimStd08.lsp"))
    C:DONR08DIMSTDLDR

    Command: DonR08dimStdldr
    Dimension style is STANDARD.
    Invalid Input.
    Ortho on> Verifying UCS set to WORLD.

    [Command History]

    Any help would be greatly appreciated.

    --
    Don Reichle
    "King Of Work-Arounds"
    Barghausen Consulting Engineers
    Kent, WA USA
    LDT3 - SP1/CD3 - SP1
    On WIN2K SP4
    Dell 1.6 Ghz P4
    512MB RAM
    NVIDIA 32MB AGP


  8. #8
    Don Reichle Guest
    PERFECT!

    Thanks, Allen.

    Sometimes its the obvious things that escape us. You just taught me
    something about Lisp.

    Have a Merry Christmas, Santa!

    --
    Don Reichle
    "King Of Work-Arounds"
    Barghausen Consulting Engineers
    Kent, WA USA
    LDT3 - SP1/CD3 - SP1
    On WIN2K SP4
    Dell 1.6 Ghz P4
    512MB RAM
    NVIDIA 32MB AGP


    "Allen Johnson" <ajohnson@dwase> wrote in message
    news:41cb1741$1_1@newsprd01...
    (command "leader" pause pause )(setvar "orthomode" 1)(command pause "" ""
    "N")

  9. #9
    T.Willey Guest
    Here is one I use.... very small simple and easy. Writen long ago, could be better, but it works why change.

    Tim

    (defun c:q(/ ot1 os1 pt1 pt2 pt3)

    (setq ot1(getvar "orthomode"))
    (setq os1(getvar "osmode"))
    (setvar "osmode" 0)
    (setq pt1(getpoint "\nSelect first point.."))
    (setq pt2(getpoint pt1 "\nSelect second point.."))
    (grdraw pt1 pt2 1)
    (setvar "orthomode" 1)
    (setq pt3(getpoint pt2 "\nSelect last point.."))
    (command "redraw")
    (if (= pt3 nil)
    (lead2)(lead3)
    )
    )


    (defun lead3()
    (command "leader" pt1 pt2 pt3 "" "" "n")
    (setvar "orthomode" ot1)
    (setvar "osmode" os1)
    (princ)
    )

    (defun lead2()
    (command "leader" pt1 pt2 "" "" "n")
    (setvar "orthomode" ot1)
    (setvar "osmode" os1)
    (princ)
    )

  10. #10
    GaryDF Guest
    Nice one.......

    We still use a pline leader...don't ask.

    Gary


    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;;;
    ;;;;;;;;;;;;;;;;;;;;;;;;;; Polyline Leader Routine
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;;;
    (defun LDRIT (/ tmp)
    (setvar "CMDECHO" 0)
    (initget "2 3 4 X")
    (setq tmp
    (getkword
    "\n* Pick Arrow Leader type: <2> Picks <3> Picks <4> Picks
    <X> CHX *"
    )
    )
    (cond
    ((= tmp "2") (LDR2IT))
    ((or (= tmp "3") (= tmp nil)) (LDR3IT))
    ((= tmp "4") (LDR4IT))
    ((= tmp "X") (CHXLDRIT))
    )
    (princ)
    )
    ;;;
    (defun LDR2IT (/ pt1 pt2 pt3)
    (ARCH:F_S-VAR)
    (setvar "CMDECHO" 0)
    ;;(ARCH:CUSTOM_LAYERS-ANNO)
    (setvar "orthomode" 0)
    (setvar "osmode" 0)
    (setq pt1 (ARCH:UPOINTX 1 "" "* Pick arrow head start point *" nil nil)
    pt2 (ARCH:UPOINTX 1 "" "* To point *" nil pt1)
    pt3 (polar pt1 (angle pt1 pt2) (* 0.2 (getvar "DIMSCALE"))) ;0.125
    )
    (setvar "osmode" 0)
    (ARCH:CUSTOM_LAYERS-ANNO-LDR)
    (command
    "PLINE"
    pt1
    "W"
    "0"
    (* 0.065 (getvar "DIMSCALE")) ;0.0417
    pt3
    "W"
    "0"
    "0"
    pt2
    )
    (command "")
    ;;(command "change" "l" "" "p" "c" "1" "")
    (ARCH:F_R-VAR)
    )
    ;;;
    (defun LDR3IT (/ pt1 pt2 pt3)
    (ARCH:F_S-VAR)
    (setvar "CMDECHO" 0)
    ;;(ARCH:CUSTOM_LAYERS-ANNO)
    (setvar "orthomode" 0)
    (setvar "osmode" 0)
    (setq pt1 (ARCH:UPOINT 1 "" "* Pick arrow head start point *" nil nil)
    pt2 (ARCH:UPOINT 1 "" "* To point *" nil pt1)
    pt3 (polar pt1 (angle pt1 pt2) (* 0.2 (getvar "DIMSCALE"))) ;0.125
    )
    (setvar "orthomode" 1)
    (ARCH:CUSTOM_LAYERS-ANNO-LDR)
    (command
    "PLINE"
    pt1
    "W"
    "0"
    (* 0.065 (getvar "DIMSCALE")) ;0.0417
    pt3
    "W"
    "0"
    "0"
    pt2
    )
    ;;(while (setq pt2 (getpoint "\n* To point *" pt2)) (command pt2))
    (setq pt2 (getpoint "\n* To point *" pt2))
    (command pt2)
    (command "")
    ;;(command "change" "l" "" "p" "c" "1" "")
    (ARCH:F_R-VAR)
    )
    ;;;
    (defun LDR4IT (/ pt1 pt2 pt3)
    (ARCH:F_S-VAR)
    (setvar "CMDECHO" 0)
    ;;(ARCH:CUSTOM_LAYERS-ANNO)
    (setvar "orthomode" 0)
    (setvar "osmode" 0)
    (setq pt1 (ARCH:UPOINT 1 "" "* Pick arrow head start point *" nil nil)
    pt2 (ARCH:UPOINT 1 "" "* To point *" nil pt1)
    pt3 (polar pt1 (angle pt1 pt2) (* 0.2 (getvar "DIMSCALE"))) ;0.125
    )
    (setvar "orthomode" 0)
    (ARCH:CUSTOM_LAYERS-ANNO-LDR)
    (command
    "PLINE"
    pt1
    "W"
    "0"
    (* 0.065 (getvar "DIMSCALE")) ;0.0417
    pt3
    "W"
    "0"
    "0"
    pt2
    )
    ;;(while (setq pt2 (getpoint "\n* To point *" pt2)) (command pt2))
    (setq pt2 (getpoint "\n* To point *" pt2))
    (command pt2)
    (setvar "orthomode" 1)
    (setq pt2 (getpoint "\n* To point *" pt2))
    (command pt2)
    (command "")
    ;;(command "change" "l" "" "p" "c" "1" "")
    (ARCH:F_R-VAR)
    )
    ;;;
    (defun LDR5IT (/ pt1 pt2 pt3)
    (ARCH:F_S-VAR)
    (setvar "CMDECHO" 0)
    ;;(ARCH:CUSTOM_LAYERS-ANNO)
    (setvar "orthomode" 0)
    (setvar "osmode" 0)
    (setq pt1 (ARCH:UPOINT 1 "" "* Pick arrow head start point *" nil nil)
    pt2 (ARCH:UPOINT 1 "" "* To point *" nil pt1)
    pt3 (polar pt1 (angle pt1 pt2) (* 0.2 (getvar "DIMSCALE"))) ;0.125
    )
    (setvar "orthomode" 0)
    (ARCH:CUSTOM_LAYERS-ANNO-LDR)
    (command
    "PLINE"
    pt1
    "W"
    "0"
    (* 0.065 (getvar "DIMSCALE")) ;0.0417
    pt3
    "W"
    "0"
    "0"
    pt2
    )
    ;;(while (setq pt2 (getpoint "\n* To point *" pt2)) (command pt2))
    (setq pt2 (getpoint "\n* To point *" pt2))
    (command pt2)
    (setq pt2 (getpoint "\n* To point *" pt2))
    (command pt2)
    (setvar "orthomode" 1)
    (setq pt2 (getpoint "\n* To point *" pt2))
    (command pt2)
    (command "")
    ;;(command "change" "l" "" "p" "c" "1" "")
    (ARCH:F_R-VAR)
    )
    ;;;
    (defun LDRCIT (/ pt1 pt2 pt3)
    (ARCH:F_S-VAR)
    (setvar "CMDECHO" 0)
    ;;(ARCH:CUSTOM_LAYERS-ANNO)
    ;;(setq tempsnap (getvar "osmode"))
    (setvar "osmode" 0)
    (setq pt1 (ARCH:UPOINT 1 "" "Pick arrow head point" nil nil)
    pt2 (ARCH:UPOINT 1 "" "To point" nil pt1)
    pt3 (polar pt1 (angle pt1 pt2) (* 0.125 (getvar "DIMSCALE")))
    )
    (setvar "orthomode" 0)
    (ARCH:CUSTOM_LAYERS-ANNO-LDR)
    (command
    "PLINE"
    pt1
    "W"
    "0"
    (* 0.0417 (getvar "DIMSCALE"))
    pt3
    "W"
    "0"
    "0"
    "arc"
    )
    ;;(while (setq pt2 (getpoint "\nTo point: " pt2)) (command pt2))
    (setq pt2 (getpoint "\nTo point: " pt2))
    (command pt2)
    ;;(setvar "osmode" tempsnap)
    (command "")
    ;;(command "change" "l" "" "p" "c" "1" "")
    (ARCH:F_R-VAR)
    )
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; UPOINT Function
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;;sorry forgot the original author
    (defun ARCH:UPOINT (bit kwd msg def bpt / inp)
    (setvar "CMDECHO" 0)
    (if def
    (setq pts (strcat (rtos (car def))
    ","
    (rtos (cadr def))
    (if (and (caddr def) (= 0 (getvar "FLATLAND")))
    (strcat "," (rtos (caddr def)))
    ""))
    msg (strcat "\n" msg " <" pts ">: ")
    bit (* 2 (fix (/ bit 2))))
    (setq msg (strcat "\n" msg " ")))
    (initget bit kwd)
    (setq inp (if bpt
    (getpoint msg bpt)
    (getpoint msg)))
    (if inp
    inp
    def))



    "T.Willey" <nospam@address.withheld> wrote in message
    news:27588152.1103829879959.JavaMail.jive@jiveforu m1.autodesk.com...
    Here is one I use.... very small simple and easy. Writen long ago, could be
    better, but it works why change.

    Tim

    (defun c:q(/ ot1 os1 pt1 pt2 pt3)

    (setq ot1(getvar "orthomode"))
    (setq os1(getvar "osmode"))
    (setvar "osmode" 0)
    (setq pt1(getpoint "\nSelect first point.."))
    (setq pt2(getpoint pt1 "\nSelect second point.."))
    (grdraw pt1 pt2 1)
    (setvar "orthomode" 1)
    (setq pt3(getpoint pt2 "\nSelect last point.."))
    (command "redraw")
    (if (= pt3 nil)
    (lead2)(lead3)
    )
    )


    (defun lead3()
    (command "leader" pt1 pt2 pt3 "" "" "n")
    (setvar "orthomode" ot1)
    (setvar "osmode" os1)
    (princ)
    )

    (defun lead2()
    (command "leader" pt1 pt2 "" "" "n")
    (setvar "orthomode" ot1)
    (setvar "osmode" os1)
    (princ)
    )

  11. #11
    T.Willey Guest
    LOL... sometimes it's whatever works.

    Tim

  12. #12
    Don Reichle Guest
    Thanks to all who shared.

    Merry Christmas to all.

    --
    Don Reichle
    "King Of Work-Arounds"
    Barghausen Consulting Engineers
    Kent, WA USA
    LDT3 - SP1/CD3 - SP1
    On WIN2K SP4
    Dell 1.6 Ghz P4
    512MB RAM
    NVIDIA 32MB AGP


    "T.Willey" <nospam@address.withheld> wrote in message
    news:9076982.1103830711171.JavaMail.jive@jiveforum 1.autodesk.com...
    LOL... sometimes it's whatever works.

    Tim

  13. #13
    T.Willey Guest
    As long as you get it to work, it's all good.

    Merry Christmas to you also, and anyone that reads this, and Happy New Years.

    Tim

Similar Threads

  1. leader vertex
    By amper in forum AutoCAD
    Replies: 1
    Last Post: 08-19-2005, 01:10 PM
  2. Leader/Reactor woes
    By Josh in forum Customization
    Replies: 2
    Last Post: 04-08-2005, 08:00 PM
  3. Leader formatting
    By juno in forum VBA
    Replies: 3
    Last Post: 03-17-2005, 05:03 PM
  4. Leader Dim Scale
    By juno in forum VBA
    Replies: 8
    Last Post: 03-10-2005, 01:50 PM
  5. Leader MDL
    By CMK in forum MicroStation
    Replies: 2
    Last Post: 02-04-2004, 06:25 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other forums: Access Forum - Microsoft Office Forum - Exchange Server Forum