Jump to content

Recommended Posts

Posted

I was wondering how to use dimensions from a lisp routine. I have a lisp that creates a custom dim style, but then I would like for it to start the dimension command. I have the "_dimlinear" in the lisp, but it doesn't allow me to pick my points. What is the command line for allowing a command to get user input in lisp like that? Thanks!

Posted

Anything like this should work:

 

(defun c:dimtest (/)
   (command "_dimlinear"
       pause
       pause
       pause
   )
   (princ)
)

 

Well, it works for me anyway - but then I am using ACAD 2004, and not 09 like you - therefore the command syntax for a linear dimension may be slightly different.

 

But let me know if this helps in any way :)

Posted

Hard to tell without seeing the code but try this...

try putting this after the line calling dimlinear

(while (> (getvar 'CmdActive) 0) (command pause))

Posted

Awsome! The "pause" worked just the way I wanted it to! Thanks guys!

 

I didn't want to start another thread for this if I didn't have to, but another question I have is about purging. I would like to figure out a lisp that is something like this...

 

If "X" dimstyle exists, purge it. If nonexistent, continue with the lisp."

 

How can I accomplish that?

Posted

(if 
(tblsearch "dimstyle" "x");predicate
(command "-purge" "d" "x" "n");if true do this [may need another "n"]
(progn                                       ; if false do this
 (code)
);progn
);if

It may give you an error if the dimstyle is referenced

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