cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can change your system assigned username to something more personal in your community settings. X

Add white background to text in Isodraw.

bfriesen
16-Pearl

Add white background to text in Isodraw.

We have a macro that inserts the file name of the file onto the illustration. Is there a way to make the text background white automatically? We currently do it manually after we add the text by the macro. If I try to create a macro the option to modify the text background is greyed out.

 

Thanks 

1 ACCEPTED SOLUTION

Accepted Solutions

Thanks to PTC support for explaining some things to me

 

Macro Add_FileName

Define h AS Integer
Define w AS Integer
Define el AS Element
w = activeDoc.window.pageX-2
h = 2

#Message "The height is " + h
#Message "The width is " + w

#Added below command to ensure number is placed on the Illustration number layer

ACTIVATE LAYER "Illustration Number"
Select none
Text Align Left
Text font 'Calibri'
Text size 6
Create Text w h stripext(activeDoc.name)
el = activeDoc.firstSelectedElement
el.text.backfill_color.type = "rgbValues"
el.text.backfill_color.rgb.red = 255
el.text.backfill_color.rgb.green = 255
el.text.backfill_color.rgb.blue = 255
el = el.nextSelectedElement

Rotate selection w h 90
Select none

End Macro

 

View solution in original post

5 REPLIES 5

Came across this today in the support search https://www.ptc.com/en/support/article/CS203689?&language=en&posno=1&q=text%20background&ProductFamily=Arbortext&source=search

 

How do I get it to find a text string. We have a seven digit numeric code that we use for our image number. Currently it works if I enter a  0

 

Macro debenedetti
# recorded with PTC Arbortext IsoDraw 7.3
	Select none
	Select if Text is equal to '0'
	Select if Text contains '0'
	MESSAGE activeDoc.selectedElements
	DEFINE el AS element
	el = activeDoc.firstSelectedElement
	
	IF (exists(el ) = false) THEN
		MESSAGE "No element in the active document!"
	Else
		WHILE (exists(el) = true)
			el.text.backfill_color.type = "rgbValues"
			el.text.backfill_color.rgb.red = 0
			el.text.backfill_color.rgb.green = 255
			el.text.backfill_color.rgb.blue = 0			
			el = el.nextSelectedElement
		END WHILE
	END If	
	Select none
End Macro

 

Any suggestions for me?

 

Bryon

Maybe I should modify my original macro instead This creates a text then places it in the bottom right corner and then rotates it 90 degrees. If I add the text backfill as suggested in the above sample from PTC. What do  need the element to be as I want it to add the background to the selection which is the text. 

 

Add_FileName

Define h As Integer
Define w As Integer
w = activeDoc.window.pageX-2
h = 2

#Message "The height is " + h
#Message "The width is " + w

#Added below command to ensure number is placed on the Illustation number layer

ACTIVATE LAYER "Illustration Number"
Select none
Text Align Left
Text font 'Calibri'
Text size 6
Create Text w h stripext(activeDoc.name)
Rotate selection w h 90
selection.text.backfill_color.type = "rgbValues"
selection.text.backfill_color.rgb.red = 255
selection.text.backfill_color.rgb.green = 255
selection.text.backfill_color.rgb.blue = 255

End Macro

 

Thanks

 

Bryon

Thanks to PTC support for explaining some things to me

 

Macro Add_FileName

Define h AS Integer
Define w AS Integer
Define el AS Element
w = activeDoc.window.pageX-2
h = 2

#Message "The height is " + h
#Message "The width is " + w

#Added below command to ensure number is placed on the Illustration number layer

ACTIVATE LAYER "Illustration Number"
Select none
Text Align Left
Text font 'Calibri'
Text size 6
Create Text w h stripext(activeDoc.name)
el = activeDoc.firstSelectedElement
el.text.backfill_color.type = "rgbValues"
el.text.backfill_color.rgb.red = 255
el.text.backfill_color.rgb.green = 255
el.text.backfill_color.rgb.blue = 255
el = el.nextSelectedElement

Rotate selection w h 90
Select none

End Macro

 

Thanks for sharing the solution!

Top Tags