CAD/CAM discussion forum > CAD > pause command LISP

pause command LISP

    
  Subscribe Topic

Rank: 1

OldForumPost

Newbie

posts: 0

Registered: 2012-1-14

Message 1 of 10

17-10-2008 03:56 . pm   |   View his/her posts only
in acad2000 lisp routines I use the pause command, to pick a point using the cursor. It doesn't seem to work in ZWcad 2008? Below I've posted a fragment form the lisp routine:



(command "qleader"
(getpoint "'nGeef startpunt op:")
pause
pause
(strcat "i.h.w. bepalen")
(strcat d " mm " c " " k)
""
)


is there anyone out there who can help me?

Rank: 1

OldForumPost

Newbie

posts: 0

Registered: 2012-1-14

Message 2 of 10

 pause command LISP
21-10-2008 04:40 . am   |   View his/her posts only
pause doesn't work in ZWCAD at all. sorry Confused

Rank: 1

OldForumPost

Newbie

posts: 0

Registered: 2012-1-14

Message 3 of 10

23-10-2008 02:50 . pm   |   View his/her posts only
that not very nice Thumbs%20Down is there a alternative? EG-P2008-10-23 22:20:35

Rank: 1

OldForumPost

Newbie

posts: 0

Registered: 2012-1-14

Message 4 of 10

24-10-2008 04:23 . pm   |   View his/her posts only
[QUOTE=EG-P]in acad2000 lisp routines I use the pause command, to pick a point using the cursor. It doesn't seem to work in ZWcad 2008? Below I've posted a fragment form the lisp routine:



(command "qleader"
(getpoint "'nGeef startpunt op:")
pause
pause
(strcat "i.h.w. bepalen")
(strcat d " mm " c " " k)
""
)


is there anyone out there who can help me?


I don't know why you used the code below:
(strcat "i.h.w. bepalen")
(strcat d " mm " c " " k)
""


I hope you can comment block these and try again.
Acturally, I don't know why you want to use these codes.

Rank: 1

i1patrick

Newbie

posts: 0

Registered: 2008-11-20

Message 5 of 10

20-11-2008 10:36 . am   |   View his/her posts only
I wrote a LISP command in AutoCAD which allowed me to insert a trim symbol, pause for the user to place it on the drawing, perform a trim operation, and finally erase the trim symbol. (Additional code included to preserve the settings of the osnap)

I have been trying to use the following code in ZWCAD with no luck:

(setq oldosmode (getvar "osmode"))
(setvar "osmode" 32)
(setq pt1 (getpoint "'nIntersection: ")
pt2 (polar pt1 0.0 0.03))


(command "insert" "tr" pt1 "" "" "")

(command "explode" "l" "")
(command "trim" "p" "" pt2 "")
(command "erase" "p" "")

(setvar "osmode" oldosmode)
(EXIT)


Any suggestions?

Rank: 1

_mac

Newbie

posts: 0

Registered: 2010-8-17

Message 6 of 10

20-11-2008 10:42 . pm   |   View his/her posts only
[QUOTE=i1patrick]I wrote a LISP command in AutoCAD which allowed me to insert a trim symbol, pause for the user to place it on the drawing, perform a trim operation, and finally erase the trim symbol. (Additional code included to preserve the settings of the osnap)

I have been trying to use the following code in ZWCAD with no luck:

(setq oldosmode (getvar "osmode"))
(setvar "osmode" 32)
(setq pt1 (getpoint "'nIntersection: ")
pt2 (polar pt1 0.0 0.03))


(command "insert" "tr" pt1 "" "" "")

(command "explode" "l" "")
(command "trim" "p" "" pt2 "")
(command "erase" "p" "")

(setvar "osmode" oldosmode)
(EXIT)


Any suggestions?


Try inserting
(setvar "osmode" 0)
before the trim command, it seems like the osap mode 32 (_int) might be interferring with the object selection at pt2 especially when pt2 is very close to pt1.

mac

Rank: 1

_mac

Newbie

posts: 0

Registered: 2010-8-17

Message 7 of 10

26-11-2008 06:56 . am   |   View his/her posts only
[QUOTE=Pavel]pause doesn't work in ZWCAD at all. sorry Confused

Pavel,

I'm sorry but you might have been mis-informed. Pause does work in ZWcad. To test this type this to the command prompt:

(command "line" pause pause "")

This should execute a line command and after entering 2 points (pause = user entry required), terminates the line command returning you to the command prompt.

Cheers,

Mac

Rank: 1

_mac

Newbie

posts: 0

Registered: 2010-8-17

Message 8 of 10

26-11-2008 07:14 . am   |   View his/her posts only
[QUOTE=Steven Sun][QUOTE=EG-P]in acad2000 lisp routines I use the pause command, to pick a point using the cursor. It doesn't seem to work in ZWcad 2008? Below I've posted a fragment form the lisp routine:



(command "qleader"
(getpoint "'nGeef startpunt op:")
pause
pause
(strcat "i.h.w. bepalen")
(strcat d " mm " c " " k)
""
)


is there anyone out there who can help me?


I don't know why you used the code below:
(strcat "i.h.w. bepalen")
(strcat d " mm " c " " k)
""


I hope you can comment block these and try again.
Acturally, I don't know why you want to use these codes.

EG-P,

Qleader by default requires user to input 3 points for the leader arrow and line, hence you would need to either terminate that on the second point with a "" to proceed to the next option, or to add an extra pause for the third point. After which it would request for another user input for the text width which ypu can supply by adding either a value or a "" before inputing the mtext strings.

Try these codes:

(command "qleader" pause pause pause ""
(strcat "i.h.w. bepalen")
(strcat d "mm" c "" k)
"")


or

(command "qleader" pause pause "" ""
(strcat "i.h.w. bepalen")
(strcat d "mm" c "" k)
"")


I hope this helps.

Happy CADDing,

Mac

Rank: 1

OldForumPost

Newbie

posts: 0

Registered: 2012-1-14

Message 9 of 10

01-12-2008 02:27 . am   |   View his/her posts only

Hi all,





I've got this lisp working for a while now, I've contacted the ZWcad support center by email. I can recommend mailing the ZWcad support center, the replies are fast and good to use. It's faster then using the forum.





Anyway, for those interested, this is a piece of the code I've used.





(setq p1 (getpoint "'nGeef startpunt op:"))
(setq p2 (getpoint p1 "'nGeef eindpunt op:"))
(command "qleader"
""
p1
p2
""
(strcat "i.h.w. bepalen")
(strcat d " mm " c " " k)
""
)






This works fine. About the pause command, it seams to work some times. Maybe only at certain commands? The following code works only with the pause command....





(if (= kz "v")
(progn
(ipeins)
(front)
(command "rotate" profiel tekst "" pt1 pause)
(setvar "osmode" os)
(setvar "clayer" lay)
(setvar "cmdecho" ce1)
(setvar "attdia" att1)
(command "_.UNDO" "End")
(setq *error* olderr )
)
(progn
(princ)
)






Perhaps someone could tell us more about the pause command?

Rank: 1

_mac

Newbie

posts: 0

Registered: 2010-8-17

Message 10 of 10

02-12-2008 12:19 . am   |   View his/her posts only


Hi,


I think it might be a communications problem with LISP and the main ZWCAD program. Your orignal codes should work with the addition of "" after the second pause, but for some reason the software is not processing it properly, it seems like it is treating the codes as if it was written usng script, which does not support the pause command. I tried typing your codes in one single line in the command prompt as follows:

(command "qleader" (getpoint "'nGeef startpunt op: ") pause pause "" (strcat "i.h.w. bepalen") (strcat d "mm" c "" k) "")

and guess what? it works just fine!!

Anyway this is not the only issue observed with the pause command. I hope they are able to resolve this with the upcoming 2009 release.


Mac

See also
X