Jump to content

why do not my function ?


hamidciv

Recommended Posts

hi dear friends

:(pleae help me for problem in easy code:

(defun c:test4()

(defun getpoly ()

(command "area" "object" ent)

(getvar "perimeter")

)

(setq ent (car(entsel)))

)

Link to comment
Share on other sites

dear mostafa

 

 

 

 

I mean this was not, i want define multiple function in one code and use them, similar to JefferyPSanders writen for addlength,

Something like this:

(defun c:test4 ()

; ;;;--- Function to get the length of an ARC entity

(defun getArc(en)

(command "lengthen" en "")

(getvar "perimeter")

)

 

;;;--- Function to get the length of a LINE entity

(defun getLine(en)

(setq enlist(entget en))

(distance (cdr(assoc 10 enlist)) (cdr(assoc 11 enlist)))

)

 

;;;--- Function to get the length of a POLY, CIRCLE, SPLINE, OR ELLIPSE

(defun getPoly(en)

(command "area" "Object" en)

(getvar "perimeter")

)

.

.

.

.

.

)

Link to comment
Share on other sites

Oops thanks marko you right. the defun must be loaded firstly.

mostafa, red line must be the last one... Order of loading functions is also important...

 

M.R.

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