TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: cjw on April 06, 2009, 11:46:59 PM

Title: How to get the arguments of funtion???
Post by: cjw on April 06, 2009, 11:46:59 PM
How to get the arguments of funtion???

Code: [Select]
;;;(JW-MK_CIRCLE LAYER CENTER RADIUS)
(defun JW-MK_CIRCLE (LAYER CENTER RADIUS)
  (if (entmake (list (cons 0 "CIRCLE")
     (cons 100 "AcDbEntity")
     (cons 100 "AcDbCircle")
     (cons 8 LAYER)
     (cons 10 CENTER)
     (cons 40 RADIUS)
       )
      )
    (entlast)
  )
)


Could only know the funtion name: "JW-MK_CIRCLE",

how to get the arguments: "(LAYER CENTER RADIUS)"???

See the picture: (But how to achieve it with LISP)


Title: Re: How to get the arguments of funtion???
Post by: CAB on April 06, 2009, 11:56:47 PM
An easy way to get the ename or nil
Code: [Select]
;;;(JW-MK_CIRCLE LAYER CENTER RADIUS)
(defun JW-MK_CIRCLE (LAYER CENTER RADIUS)
  (entmakex (list (cons 0 "CIRCLE")
                  (cons 8 LAYER)
                  (cons 10 CENTER)
                  (cons 40 RADIUS)
            )
  )
)
Title: Re: How to get the arguments of funtion???
Post by: cjw on April 07, 2009, 12:26:38 AM
An easy way to get the ename or nil
Code: [Select]
;;;(JW-MK_CIRCLE LAYER CENTER RADIUS)
(defun JW-MK_CIRCLE (LAYER CENTER RADIUS)
  (entmakex (list (cons 0 "CIRCLE")
                  (cons 8 LAYER)
                  (cons 10 CENTER)
                  (cons 40 RADIUS)
            )
  )
)

It's must be something mistake about my question~~again~


repeat my question:

1. only know the "JW-MK_CIRCLE" funtion name~
2. don't know the "(LAYER CENTER RADIUS)" arguments
3. Want to use the symbol JW-MK_CIRCLE to get the "(LAYER CENTER RADIUS)" arguments


Title: Re: How to get the arguments of funtion???
Post by: cjw on April 07, 2009, 12:36:31 AM
PS:
 return "(LAYER CENTER RADIUS)"

LAYER、CENTER 、RADIUS are all symbol ~ not value

Title: Re: How to get the arguments of funtion???
Post by: cjw on April 07, 2009, 12:50:23 AM
Just like this:
SubFunction Manager
(But I do this with stupid method ,write it one by one)
Title: Re: How to get the arguments of funtion???
Post by: jxphklibin on April 07, 2009, 02:41:44 AM
PS:
 return "(LAYER CENTER RADIUS)"

LAYER、CENTER 、RADIUS are all symbol ~ not value



you should ask : "How to get the parameters of function?"
Title: Re: How to get the arguments of funtion???
Post by: cjw on April 07, 2009, 05:24:06 AM
PS:
 return "(LAYER CENTER RADIUS)"

LAYER、CENTER 、RADIUS are all symbol ~ not value



you should ask : "How to get the parameters of function?"

 :? :-P
Title: Re: How to get the arguments of funtion???
Post by: ronjonp on April 07, 2009, 10:28:13 AM
I think you want to inspect the function like so:

Title: Re: How to get the arguments of funtion???
Post by: CAB on April 07, 2009, 10:32:17 AM
I think he wants to query the function with a lisp routine.
Just a guess. 8-)
Title: Re: How to get the arguments of funtion???
Post by: ronjonp on April 07, 2009, 10:33:50 AM
Guess I should read everything in the post  :oops: