PDA

View Full Version : having problems with setting orthmode in lisp routine.


voigtmark
2006-03-09, 05:53 PM
i have been trying to get this line of code to work.The first line of code wroks without crashing. It sets the ortho but at the wrong time. the second line causes the program to crash. this is a line from a larger routine the entire code is atached. What do i need to do to make this work?

(command "pline" pause (setvar "orthomode" 1) pause pause "" "");this works

(command "pline" pause pause (setvar "orthomode" 1) pause "" "");does not work

.T.
2006-03-09, 09:33 PM
This may get you going, but it's quick and dirty, as I didn't have a lot of time to spend on it.


(defun c:gl ()
; (initerr) ;<--commented for testing purposes only; function not tested
(setvar "cmdecho" 1) ;<--added to have command prompts in pline, insert and dtext
;commands, otherwise the user doesn't know what's going on unless you give them prompts
(setvar "orthomode" 0);<<--Extra quote removed
(command "-style" "notes" "romans.shx" "4.75" "0.85" "10" "n" "n" "n");<-Don't forget the leading
;0 in reals < 1.0 IE: 0.85 not .85
(setvar "osmode" 512)
; (command "-insert" "grabm" pause "" "" pause);<--commented for testing purposes; I didn't
;take time to create a block
(command "pline" pause pause);<-- you can continue a command later by calling the
;command function again as long as you don't execute a diffrent command in between
(setvar "orthomode" 1)
(command pause "");;<<--moved pause and removed extra "enter" (""); finishes up the pline
;command
(setvar "osmode" 0)
(command "dtext" pause "0");are you manually placing the text insertion point?
;(reset) ;<--commented for testing purposes only; function not tested
(princ)
)


Also, a lot of people have spent a lot of time on routines similar to this. Have you looked in
the Archive (http://www.augi.com/exchange/) to see if there is something you can use, or get ideas from?

Take care,

voigtmark
2006-03-10, 01:58 PM
thanks i looked at a lot of different web sites and things for ideas. i eventually worked out the solution.turns out it was he same as yours. thanks for the help.