Stumped by Simple Leader command
CADForums.net Forum Index CADForums.net
Discussion of AutoCAD and other CAD software.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web cadforums.net
Stumped by Simple Leader command

 
Post new topic   Reply to topic    CADForums.net Forum Index -> Customization
Author Message
Don Reichle
Guest





Posted: Thu Dec 23, 2004 11:24 pm    Post subject: Stumped by Simple Leader command Reply with quote

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

Back to top
T.Willey
Guest





Posted: Thu Dec 23, 2004 11:44 pm    Post subject: Re: Stumped by Simple Leader command Reply with quote

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
Back to top
Don Reichle
Guest





Posted: Thu Dec 23, 2004 11:58 pm    Post subject: Re: Stumped by Simple Leader command Reply with quote

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@jiveforum1.autodesk.com...
Quote:
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.
Quote:

Tim


Back to top
Don Reichle
Guest





Posted: Fri Dec 24, 2004 12:01 am    Post subject: Re: Stumped by Simple Leader command Reply with quote

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@jiveforum1.autodesk.com...
Quote:
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.
Quote:

Tim
Back to top
Allen Johnson
Guest





Posted: Fri Dec 24, 2004 12:06 am    Post subject: Re: Stumped by Simple Leader command Reply with quote

(command "leader" pause pause )(setvar "orthomode" 1)(command pause "" ""
"N")
Back to top
T.Willey
Guest





Posted: Fri Dec 24, 2004 12:14 am    Post subject: Re: Stumped by Simple Leader command Reply with quote

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
Back to top
GaryDF
Guest





Posted: Fri Dec 24, 2004 12:17 am    Post subject: Re: Stumped by Simple Leader command Reply with quote

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...
Quote:
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


Back to top
Don Reichle
Guest





Posted: Fri Dec 24, 2004 12:21 am    Post subject: Re: Stumped by Simple Leader command Reply with quote

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...
Quote:
(command "leader" pause pause )(setvar "orthomode" 1)(command pause "" ""
"N")

Back to top
T.Willey
Guest





Posted: Fri Dec 24, 2004 12:24 am    Post subject: Re: Stumped by Simple Leader command Reply with quote

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)
)
Back to top
GaryDF
Guest





Posted: Fri Dec 24, 2004 12:29 am    Post subject: Re: Stumped by Simple Leader command Reply with quote

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@jiveforum1.autodesk.com...
Quote:
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)
)
Back to top
T.Willey
Guest





Posted: Fri Dec 24, 2004 12:38 am    Post subject: Re: Stumped by Simple Leader command Reply with quote

LOL... sometimes it's whatever works.

Tim
Back to top
Don Reichle
Guest





Posted: Fri Dec 24, 2004 1:38 am    Post subject: Re: Stumped by Simple Leader command Reply with quote

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@jiveforum1.autodesk.com...
Quote:
LOL... sometimes it's whatever works.

Tim
Back to top
T.Willey
Guest





Posted: Fri Dec 24, 2004 1:45 am    Post subject: Re: Stumped by Simple Leader command Reply with quote

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
Back to top
 
Post new topic   Reply to topic    CADForums.net Forum Index -> Customization All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Windows Server DSP VoIP Electronics New Topics
Powered by phpBB