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

merge attributs in attribut

3 REPLIES 3
Reply
Message 1 of 4
^_^clovis^_^
296 Views, 3 Replies

merge attributs in attribut

Hello,

I have valve block with severals attributs that are sending to Excel (tag1 -> column 1, tag2 -> column 2..).

For easier handling (moving value around), I'd like to have 1 visual attibut resulting (strcat tag1 tag2 tag3) which would be automaticaly updated when one of the tag is modified.

Should I use : vlr-lisp-reactor or is there an easier way to do that?

Thanks

 

 

3 REPLIES 3
Message 2 of 4
Moshe-A
in reply to: ^_^clovis^_^

Hi,

 

it's OK to use (vlr-lisp-reactor) if you are sure that the only way these attributes wil be modifies with lisp commands

but what will happand if they will be modifies with a regular command?

 

consider using (vlr-acdb-reactor) also

 

Moshe

 

 

Message 3 of 4
Lee_Mac
in reply to: ^_^clovis^_^

Assuming I have correctly understood what you are looking to achieve, I would suggest using a Field as the value of the visible attribute, referencing the values of the other three attributes. The Field will then automatically update (following a regen) when the content of any of the other three attributes is altered.

 

Lee

Message 4 of 4
^_^clovis^_^
in reply to: Lee_Mac

Hello Guys,

Yes, that's it.

I have blocks in drawings (P&ID) with a TAG nr underneath.

The Tag is splitted in 5 attributs.

Tag1 s1 Tag2 s2 Tag3 (for a pump : P.01.01) (s1 and s2 are separators)

The point is it's a bit difficult to move them when needed.

I've already made a function to make that easier. But having the drafter working with only one attribut seems better.

 

 

;Tag mov
(defun c:tagm( / abx p1 p2 p3 p4 p5 listatt pas startPoint hoek findAtt)	
	(prompt "\nSelect tag to move..")
	(setq abx (ob))
	(setq findAtt nil)
	(if (/= (vla-get-HasAttributes abx) :vlax-true)
		(progn
			(prompt "\nNo attributes here..")
			(exit)
		)
	)
		
	(vla-highlight abx 1)
	(setq listAtt(vlax-safearray->list(vlax-variant-value(vla-getattributes abx))))
	(foreach att listAtt
		(if (= (vla-get-tagString att) "TAG01")
			(setq startPoint(vlax-get att "TextAlignmentPoint")
					findAtt T
			)
		)
	)
	(if (not findAtt)
		(progn
			(prompt "\nBlock outdated, nothing to do..")
			(vla-highlight abx 0)
			(exit)
		)
	)
	(setq startpoint(reverse(cdr(reverse startPoint))))
	(setq hoek (vla-get-Rotation abx))
	(setq p1 (getpoint startPoint "\nNew Position.."))
	(setq p2 (polar p1 hoek 1.0))
	(setq p3 (polar p2 hoek 3.0))
	(setq p4 (polar p3 hoek 3.0))
	(setq p5 (polar p4 hoek 0.5))
	(setq pas nil)
	(foreach att listAtt
		(cond
            ((= (vla-get-tagString att) "TAG01")(vlax-put-property att 'TextAlignmentPoint (vlax-3d-point p1)))
            ((= (vla-get-tagString att) "TAG02")(vlax-put-property att 'TextAlignmentPoint (vlax-3d-point p3)))
            ((= (vla-get-tagString att) "TAG03")(vlax-put-property att 'TextAlignmentPoint (vlax-3d-point p5)))
            ((= (strcase(vla-get-tagString att)) "S2")(vlax-put-property att 'TextAlignmentPoint (vlax-3d-point p4)))
            ((= (strcase(vla-get-tagString att)) "S1")(vlax-put-property att 'TextAlignmentPoint (vlax-3d-point p2)))
        ) ) (vla-highlight abx 0) )

 

Thanks

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

Post to forums  

”Boost