Jump to content

Still learning


flowerrobot

Recommended Posts

hey, im still learning alot of the format of how to present a lisp commands,

could some one please tell me why this code wont work?

 

(DEFUN C:da()
(GRAPHSCR)
(if (= 1 (getvar "dimlfac"))
(progn
(command "dimclrt" 2)        ;yellow text
(command "linetype" "s" "continuous"\\)
(command ".layer" "m" "dim" \)
(command "celweight" 15)
(command "_dimaligned")
);progn
(progn
(command "dimclrt" 3)        ;green text
(command "linetype" "s" "continuous"\\)
(command ".layer" "m" "dim" \)
(command "celweight" 15)
(command "_dimaligned")
);progn
);if
)

Link to comment
Share on other sites

In a lisp "command" function, use "pause" instead of a backslash:

 

not - (command "linetype" "s" "continuous"\\)

instead - (command "linetype" "s" "continuous" pause pause)

Link to comment
Share on other sites

Thanks guys, ill have a look on monday, the weird thing is, it works for all other commands except this one aye, ive got 10 code similar with the same format and they work it was only this one that dosnt, do you kno why they work yet this one dosnt?

 

could you also please explain why i should use your methods? as i dont under stand the difference,why "" can = \\ while "" can also = \ please excuse my ignorance

Link to comment
Share on other sites

neither work for some reason

if i run the vba in autocad it works fine

if i copy it into the command line it loads fine

i dont understand it works fine for all the other commands just not this one???

;Dimension angled
(defun c:da()
(graphscr)
(if (= 1 (getvar "dimlfac")) 
(progn
(command "dimclrt" 2)        ;yellow text
(command "linetype" "s" "continuous" pause pause)
(command ".layer" "m" "dim" pause)
(command "celweight" 15)
(command "dimaligned")
);progn
(progn
(command "dimclrt" 3)    ;green txt
(command "linetype" "s" "continuous" pause pause)
(command ".layer" "m" "dim" pause)
(command "celweight" 15)
(command "dimaligned")
);progn
);if
)

 

;Dimension angled
(defun c:da()
(graphscr)
(if (= 1 (getvar "dimlfac")) 
(progn
(command "dimclrt" 2)        ;yellow text
(command "linetype" "s" "continuous" "" "")
(command ".layer" "m" "dim" "")
(command "celweight" 15)
(command "dimaligned")
);progn
(progn
(command "dimclrt" 3)    ;green txt
(command "linetype" "s" "continuous" "" "")
(command ".layer" "m" "dim" "")
(command "celweight" 15)
(command "dimaligned")
);progn
);if
)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...