Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Reply
Contributor
vahe.holtian
Posts: 22
Registered: ‎10-30-2012
Message 1 of 4 (187 Views)
Accepted Solution

lisp modification help (automatic attribute selection)

187 Views, 3 Replies
11-30-2012 01:51 AM

hey

 

i have a very useful lisp routine that helps me increment the numbers in the selected tag.

 

i just want to make it choose the tag ("BAR_MARK") automatically..

(meaning that clicking on the block wil do the work and its not necessary to click on the tag)

 

can anyone help?

 

 

 

 

 

 

 

 

quick mode on the code 

 

here's a snippet, [refer to the attached file]

 

(while (and (/= fin 1) (not (or (= id "Pause") (= id "TEXT") (= id "MTEXT") Tag_found )))

 

 

((/= obj nil) (setq objid (entget (car obj)))
(setq id (cdr (assoc 0 objid)))
(setq Tag_found
(if (and (= id "INSERT")
(= (cdr (assoc 66 objid)) 1)
(setq obj (vl-remove-if-not
'(lambda (j)
(eq (vla-get-tagstring j) "BAR_MARK")
)
(vlax-invoke (setq vl_obj (vlax-ename->vla-object (car obj))) 'Getattributes)
))
(setq obj (list (vlax-vla-object->ename (car obj)))))
T nil))
)

 

 

 

 

*Expert Elite*
pbejse
Posts: 2,511
Registered: ‎11-24-2009
Message 2 of 4 (181 Views)

Re: lisp modification help (automatic attribute selection)

11-30-2012 03:06 AM in reply to: vahe.holtian

quick mode on the code 

 

here's a snippet, [refer to the attached file]

 

(while (and (/= fin 1) (not (or (= id "Pause") (= id "TEXT") (= id "MTEXT") Tag_found )))

 

 

((/= obj nil) (setq objid (entget (car obj)))
					 (setq id (cdr (assoc 0 objid)))
					 (setq Tag_found 
					 (if (and (= id "INSERT")
						  (= (cdr (assoc 66 objid)) 1)
						  (setq obj (vl-remove-if-not
							  '(lambda (j)
							     (eq (vla-get-tagstring j) "BAR_MARK")
							   )
							  (vlax-invoke (setq vl_obj (vlax-ename->vla-object (car obj))) 'Getattributes)
							))
						  (setq obj (list (vlax-vla-object->ename (car obj)))))
					   	  T nil))
					 )

 

 

 

 

Contributor
vahe.holtian
Posts: 22
Registered: ‎10-30-2012
Message 3 of 4 (165 Views)

Re: lisp modification help (automatic attribute selection)

11-30-2012 10:45 PM in reply to: pbejse

thank you!! :smileyvery-happy:

*Expert Elite*
pbejse
Posts: 2,511
Registered: ‎11-24-2009
Message 4 of 4 (163 Views)

Re: lisp modification help (automatic attribute selection)

11-30-2012 11:02 PM in reply to: vahe.holtian

vahe.holtian wrote:

thank you!! :smileyvery-happy:


You are welcome vahe.holtian.keep on coding.

 

Cheers

 

 

 

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.