Update Boundary Width of multi line attribute

Update Boundary Width of multi line attribute

aeldrawingoffice
Contributor Contributor
1,009 Views
7 Replies
Message 1 of 8

Update Boundary Width of multi line attribute

aeldrawingoffice
Contributor
Contributor

Hi

 

I have a couple hundred of borders that have a multi-line attribute within them that needs it's boundary width updated to 115

 

The attributes name within the border is DRAWING_STATUS

 

What I'm looking to do is run a script over these drawings that will open these drawings, call a lisp routine to update the boundary width on this one particular attribute, zoom extents and save.

 

Is there anyone that could help with this please.

 

Thanks

Simon

0 Likes
1,010 Views
7 Replies
Replies (7)
Message 2 of 8

devitg
Advisor
Advisor

@aeldrawingoffice Please upload a sample.dwg 

 

 

With a before and after , as you need it. 

 

 

 

0 Likes
Message 3 of 8

aeldrawingoffice
Contributor
Contributor

files attached.

 

Attribute is bottom left.  Currently populated with the work MASTER

0 Likes
Message 4 of 8

pbejse
Mentor
Mentor

The block "TE_1-250_A1_1030" is on Model space?

 

0 Likes
Message 5 of 8

pbejse
Mentor
Mentor

Download this support file ObjectDBX Wrapper 

 

Load the above file along with the code below.

(defun c:MTBW ( / _MTWdithTo115)
(defun _MTWdithTo115 ( doc / f)
 	(vlax-for atb (Vla-get-modelspace doc)
	  (if
	    (and
		    (vlax-write-enabled-p atb)
		    (eq (Vla-get-objectname atb) "AcDbBlockReference")
		    (eq (if (vlax-property-available-p atb 'effectivename)
	                                        (vla-get-effectivename atb)
	                                        (vla-get-name atb)
	                                    )
							"TE_1-250_A1_1030")
		    (minusp (Vlax-get atb 'HasAttributes))
		    (setq f (assoc "DRAWING_STATUS" (mapcar '(lambda (at)
							       (list (vla-get-TagString at) at))
							    (Vlax-invoke atb 'GetAttributes))))	    
		    )
	    (progn
	  	(vlax-put (cadr f) 'MTextBoundaryWidth 115.00)
  		(princ (Strcat "\n Block at " (vl-filename-base  (vla-get-name doc)) " modified" )))
	    )
 	)
  )
  
	(LM:ODBX '_MTWdithTo115 nil t)
  (princ)
  )

 

HTH

 

0 Likes
Message 6 of 8

aeldrawingoffice
Contributor
Contributor

Thanks for the help and effort.

 

I ran this on one of the drawings but got the error below

 

Command: MTBW

; error: no function definition: LM:ODBX

0 Likes
Message 7 of 8

devitg
Advisor
Advisor
0 Likes
Message 8 of 8

pbejse
Mentor
Mentor

@aeldrawingoffice wrote:

Thanks for the help and effort.

 

I ran this on one of the drawings but got the error below

 

Command: MTBW

; error: no function definition: LM:ODBX


How was it that you were able to load MTBW but not the other one?  As intructed before at post #5

drawingoffice.JPG

 

You can follow the link posted by  @devitg on the previous post as well

 

HTH

 

 

0 Likes