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

0 Members and 1 Guest are viewing this topic.

cjw

  • Guest
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)



CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
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

  • Guest
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



cjw

  • Guest
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


cjw

  • Guest
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 »

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

  • Guest
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

ronjonp

  • Needs a day job
  • Posts: 7526
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 11 x64 - AutoCAD /C3D 2023

Custom Build PC

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
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: 7526
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 11 x64 - AutoCAD /C3D 2023

Custom Build PC