Modifying a blocks Custom Drawing Properties

Modifying a blocks Custom Drawing Properties

SORONW
Advocate Advocate
627 Views
1 Reply
Message 1 of 2

Modifying a blocks Custom Drawing Properties

SORONW
Advocate
Advocate

In preparation for an impending upgrade, we have had to develop a new title block block. This new block makes use of an external PLM software to control 'most' fields through a number of custom drawing properties. The problem is that when inserting the block into a new drawing, there doesn't appear to be a way to modify the few remaining fields through a Lisp Routine.

https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/vla-addcustominfo-function/td-p/1471...

(defun PutCustomInfo (ID Value Index / Info Num) 
	(and
		(vl-load-com)
		(or *acad* (setq *acad* (vlax-get-acad-object)))
		(or *doc* (setq *doc* (vlax-get *acad* 'ActiveDocument)))
		(vlax-property-available-p *doc* 'SummaryInfo)
		(setq Info (vlax-get *doc* 'SummaryInfo))
		(setq Num (vla-NumCustomInfo Info))
		(setq Index (max Index 0))
		(if (> Index Num)
			(not (vla-AddCustomInfo Info ID Value))
			(not (vla-SetCustomByIndex Info Index ID Value))
		);if
	);and
);defun

(PutCustomInfo "scale" ps 0 )

I can use the above code to modify the custom property directly in the titleblock .dwg, but not when inserted into another drawings.

 

Any suggestions?

0 Likes
628 Views
1 Reply
Reply (1)
Message 2 of 2

Moshe-A
Mentor
Mentor

@SORONW  hi,

 

just a thought 😀 what about linking the block reference (your title) to the dwg using hyperlink?

maybe attaching the custom fields from dwgprops using xdata?

 

Moshe

 

0 Likes