Author Topic: How to get the arguments of funtion???  (Read 2063 times)

0 Members and 1 Guest are viewing this topic.

cjw

  • Newt
  • Posts: 162
How to get the arguments of funtion???
« 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)


The slow need to start early!

CAB

  • Global Moderator
  • Seagull
  • Posts: 10376
Re: How to get the arguments of funtion???
« Reply #1 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)
            )
  )
)
« Last Edit: April 07, 2009, 12:00:31 AM by CAB »
I've reached the age where the happy hour is a nap. ()
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

cjw

  • Newt
  • Posts: 162
Re: How to get the arguments of funtion???
« Reply #2 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


The slow need to start early!

cjw

  • Newt
  • Posts: 162
Re: How to get the arguments of funtion???
« Reply #3 on: April 07, 2009, 12:36:31 AM »
PS:
 return "(LAYER CENTER RADIUS)"

LAYER、CENTER 、RADIUS are all symbol ~ not value

The slow need to start early!

cjw

  • Newt
  • Posts: 162
Re: How to get the arguments of funtion???
« Reply #4 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)
« Last Edit: April 07, 2009, 12:57:13 AM by cjw »
The slow need to start early!

jxphklibin

  • Guest
Re: How to get the arguments of funtion???
« Reply #5 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?"

cjw

  • Newt
  • Posts: 162
Re: How to get the arguments of funtion???
« Reply #6 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
The slow need to start early!

ronjonp

  • Needs a day job
  • Posts: 7071
Re: How to get the arguments of funtion???
« Reply #7 on: April 07, 2009, 10:28:13 AM »
I think you want to inspect the function like so:


Windows 10 x64 - AutoCAD /C3D 2020

Custom Build PC

CAB

  • Global Moderator
  • Seagull
  • Posts: 10376
Re: How to get the arguments of funtion???
« Reply #8 on: April 07, 2009, 10:32:17 AM »
I think he wants to query the function with a lisp routine.
Just a guess. 8-)
I've reached the age where the happy hour is a nap. ()
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

ronjonp

  • Needs a day job
  • Posts: 7071
Re: How to get the arguments of funtion???
« Reply #9 on: April 07, 2009, 10:33:50 AM »
Guess I should read everything in the post  :oops:

Windows 10 x64 - AutoCAD /C3D 2020

Custom Build PC