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

Processing multiple items

4 REPLIES 4
Reply
Message 1 of 5
bdsmls
230 Views, 4 Replies

Processing multiple items

I've tried to figure out how to make this work and i'm stumped.

I want to select multiple items and run a set of commands for each item individually.

the routine draws a detail of the selected items and works great if the items i select are identical in every way,

otherwise it details only the first item in the group.

any help would be greatly appreciated

 

Thanks,

Larry

 

this is my condensed routine:

 

(DEFUN C:MYROUTINE()

(PROMPT "\n\n\nSelect items to detail:")
(SETQ OBJECT(SSGET))
(SETQ PQTY(SSLENGTH OBJECT))
(SETQ NP1(SSNAME OBJECT 0))
(SETQ N1(CDR(ASSOC 0(ENTGET NP1))))

(IF(= N1 "ENGCENTITY")(PROGN...

   (run a series of definitions)

 

(DEFUN DRAWEC()
(IF(= PTYPE "A")(PROGN...

   (define a series of points)

(COMMAND "PLINE" P1 "W" "0" "" P2 P3 P4 "C" "")

 )

 

(REPEAT PQTY (DRAWEC))

 

(PRINC))

 

 

 

4 REPLIES 4
Message 2 of 5
Lee_Mac
in reply to: bdsmls

Message 3 of 5
bdsmls
in reply to: Lee_Mac

i'll check it out

thanks

Message 4 of 5
bdsmls
in reply to: Lee_Mac

i don't know what i'm missing, but it's still draws all details with the parameters of the first item in the selection set

Message 5 of 5
hmsilva
in reply to: bdsmls

If I understood correctly, perhaps something like this

 

(DEFUN C:MYROUTINE ()

  (DEFUN DRAWEC	()
    (IF	(= PTYPE "A")
      (PROGN...
	(define a series of points)
	(COMMAND "PLINE" P1 "W" "0" "" P2 P3 P4 "C" "")
      );; progn
    );; if
  );; DRAWEC


(PROMPT "\n\n\nSelect items to detail:")
(if (SETQ OBJECT (SSGET))
  (progn
    (SETQ PQTY (SSLENGTH OBJECT))
    (while (SETQ NP1 (SSNAME OBJECT 0))
      (SETQ N1 (CDR (ASSOC 0 (ENTGET NP1))))

      (IF (= N1 "ENGCENTITY")
	(PROGN...

	  (run a series of definitions)

	  (DRAWEC)
	);; progn
      );; if
      (ssdel NP1 OBJECT)
    );; while
  );; progn
);; if
(PRINC)
);; MYROUTINE

 

hope that helps

Henrique

EESignature

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

Post to forums  

Autodesk Design & Make Report

”Boost