Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Aquiring Information

8 REPLIES 8
Reply
Message 1 of 9
Anonymous
114 Views, 8 Replies

Aquiring Information

This tis no more than a cut and paste from the filter lsp routine. Basically, I need a routine to collect all of the below information and put it into a text file...I'm not really sure where to begin....


(defun do_circle()
(foreach n entity_lisp_init
(cond
((= 0 (car n)) (group_0 "Circle"))
((= 8 (car n)) (group_8 "Layer"))
((= 6 (car n)) (group_8 "Linetype"))
((= 38 (car n)) (group_40 "Elevation"))
((= 39 (car n)) (group_40 "Thickness"))
((= 62 (car n)) (group_62 "Color"))
((= 48 (car n)) (group_40 "Linetype Scale"))
((= 10 (car n)) (group_10 "Circle Center"))
((= 40 (car n)) (group_40 "Circle Radius"))
((= 210 (car n)) (group_210))
((= -3 (car n)) (group_-3))
)
)
)
;;
8 REPLIES 8
Message 2 of 9
BillZ
in reply to: Anonymous

Just paste this into a text file (notepad works) and save with the extension of .lsp, then from the command line type: (load "myfilename") , the name of the file should come up with capital letters at the command line, this means the file has loaded. Then type (do_circle) and hit enter, this will start the program.
BillZ
Message 3 of 9
Anonymous
in reply to: Anonymous

In case you are using 2000+

(vl-load-com)

(setq ent (car (entsel)))

(setq obj (vlax-ename->vla-object
ent))

(vlax-dump-object obj T) ;<dump object
properties and methods>

 

and after that you can use:

vla-get-radius... etc.

 

-Luis


style="BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px">
This
tis no more than a cut and paste from the filter lsp routine. Basically, I
need a routine to collect all of the below information and put it into a text
file...I'm not really sure where to begin....


(defun do_circle()
    (foreach n entity_lisp_init

      (cond

        ((= 0 (car n)) (group_0
"Circle"))
        ((= 8 (car n))
(group_8 "Layer"))
        ((= 6
(car n)) (group_8 "Linetype"))

        ((= 38 (car n)) (group_40
"Elevation"))
        ((= 39 (car
n)) (group_40 "Thickness"))

        ((= 62 (car n)) (group_62
"Color"))
        ((= 48 (car n))
(group_40 "Linetype Scale"))

        ((= 10 (car n)) (group_10
"Circle Center"))
        ((= 40
(car n)) (group_40 "Circle Radius"))

        ((= 210 (car n))
(group_210))
        ((= -3 (car
n)) (group_-3))
      )

    )
  )

  ;;

Message 4 of 9
Anonymous
in reply to: Anonymous

Bill,
The routine is working I assume. It is working transparently but I need the info to show up somehow like in a seperate text file....
Message 5 of 9
BillZ
in reply to: Anonymous

I think I see now what you mean.
((= 0 (car n))(princ(group_0 "Circle")))
Add the princ to each line and the result from each true statement will print to the screen. Tell me if I'm getting "warm".
BillZ
Message 6 of 9
Anonymous
in reply to: Anonymous

I added the "princ" statement to each line although I am not seeing it show-up on the screen
Message 7 of 9
BillZ
in reply to: Anonymous

Sorry my syntax was wrong:
(princ "group_0 Circle")
Fix each line as this and try it again.
BillZ
Message 8 of 9
Anonymous
in reply to: Anonymous

I am assuming that the reason I cannot get this thing to work is the fact I hsve to have the "Group_?" lsp within the command itself...
Message 9 of 9
BillZ
in reply to: Anonymous

You might have to post your files before I can tell you for sure, but if the cond function fires a group_? subroutine, then you have to make sure you load that function at the start of or before the main function.
BillZ

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost