Jump to content

how calling command with different methods for drawing in autolisp?


hamidciv

Recommended Posts

hi dear friends

:(how can drawing object with different methods in autolisp?

for example in normal command arc in below

(command "arc" s c e "c")

s= start point

c=second point

e=end point

 

in this method arc drawed with start center end , but i want arc drawed with

start center angle, how do this in autolisp?

thanks a lot

Link to comment
Share on other sites

hi hanhphuc

i think you dont understand my guestion, i want drawing arc with star center angle method , that is also in toolbar autocad availabe.

thanks

Link to comment
Share on other sites

hi hanhphuc

i think you dont understand my guestion, i want drawing arc with star center angle method , that is also in toolbar autocad availabe.

thanks

 

sorry i misunderstood..

(COMMAND "ARC" s "C" c "A" (- (angle c e) (angle c s)))

if you use "COMMAND" (drawing object etc..) in your code, be careful if "osmode" is enabled. That's why we prefer entmake or vla-addArc

(defun c:test (/ s c e); entmake
(if (and (setq s (getpoint "\nStart.. "))
 (setq c (getpoint "\nCenter.. "))
 (setq e (getpoint "\nEnd.."))
 ) ;_ end of setq
 (entmakex (list '(0 . "ARC")
	  (cons 10 c)
	  (cons 40 (distance c s))
	  (cons 50 (angle c s))
	  (cons 51 (angle c e))
	  ) ;_ end of list
    ) ;_ end of entmakex
 ) ;_ end of if
)

Edited by hanhphuc
entmake example
Link to comment
Share on other sites

thanks a lot dear hanhphuc

I think the code is incorrect

(COMMAND "ARC" s "C" c "A" (- (angle c e) (angle c s)))

Edited by hamidciv
Link to comment
Share on other sites

dear mostafa

if your possible , please explain more this command?

What is your mean of the pause?

pause is meant let user input, the command is suspended to allow direct user input (usually point selection or dragging).

Link to comment
Share on other sites

thanks a lot dear hanhphuc

I think the code is incorrect

(COMMAND "ARC" s "C" c "A" (- (angle c e) (angle c s)))

 

oops sorry, if automation "command" with variable not working maybe due to environment settings "angdir" or angle units in command input radians or degrees vice verse?

 

(command "arc" "c" pause pause "angle" pause "")

@mostafa badran, thanks :)

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