Jump to content

Recommended Posts

Posted (edited)

Hi!

 

I tried this in AutoCAD 2018:

 

 

(defun c:CCA ()

 (setq R 10)
 (setq H 10)
 
 (setq N 1)

 (command "circle"  p1  R)

 (while
 (setq p1 (getpoint "Centre:"))

 (command "circle"  p1  R)

 (command "Text" "j" "M" p1 H 0 N "" )
 (setq N (+N 1 ))
 
 )

 

but result:

bad argument type: 2D/3D point: nil

 

Can somebody help me? thanks a lot.

Edited by SLW210
Added Code Tags.
Posted

Hi,

 

The first variable p1 is equal to nil when you start up that routine so that's why it fails.

 

Just for your understanding;

 

(defun c:cca (/ r h n p1)
 (setq r 10
       h 10
       n 0
 )
 (while (setq p1 (getpoint "Centre:"))
   (command "circle" "_non" p1 r)
   (command "Text" "j" "M" "_non" p1 h 0 (setq n (1+ n)))
 )
 (princ)
)

Posted

; see tharwat :-)

sorry Tharwat , didn't see your response when I submitted...

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