Jump to content

Recommended Posts

Posted

Hi I'm doing my first macro and trying to place a coordinate reference on a layout, I want to get a cross in the center of a tank and the xy coordinates but I dont get the lines to work, any one who could help me. This is a part of the code I believe should draw my centerlines. but I get a error: bad function: when i test it.

 

It's my first attempt on lisp I'm not sure it's correct.

 


(defun c:cross ( / xyz xyz3 ptx pty ptz size x1 y1 ylin xlin uprec)

; Ask user for the number of decimal places: 

(setq uprec (getint "Label precision: ")) 


(setq xyz (getpoint "pick point: " ))
     (setq ptx (car xyz)
    pty (cadr xyz)
    pzz (caddr yxz)
    )
     (setq size (getint "Tank diameter:" ))
     
     
; Truncate values: 

(setq ptx ( ptx 2 uprec) )

(pty ( pty 2 uprec))
(ptz ( ptz 2 uprec)) 
(setq x1 (ptx - size)
    y1 ( pty - size)
    )
 (setq ylin (strcat ptx y1 pz)
xlin (strcat x1 pty ptz)
)
 (command "line" ylin )
 (command "polar" size 90 "" )
 (command "line" "polar" size 0 "")
     )


     
     

Posted

You can use the command "dimcenter" to make a cross in a circle.

 

Regards.

Posted

lisp tries to evaluate the first 'argument' after a ( as a function. ptx, pty, ptz are not a functions- hence the bad function

also check your variables for typos

there is no command 'Polar' in autocad

you're trying to supply a string to the line command

just a start

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