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

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

Arbortext Isodraw Macro Text edit

FrancisPaille
7-Bedrock

Arbortext Isodraw Macro Text edit

Hi Everybody

I need help on that one... i could not find script for editing text...

I need to remove cs text on reference inside illustration

ex:reference cs123_xyw

need to be rename 123_xyz

Thanks a lot for support!!!

 

Macro Delete CS
# recorded with Arbortext IsoDraw 7.3

Select if text contains 'cs'

from selection...

???delete cs???

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Try this script:

 

Macro Remove cs
DEFINE el as Element
Select if Text contains 'cs'

IF (exists(activeDoc.firstSelectedElement)) THEN
	el = activeDoc.firstSelectedElement
	WHILE (exists(el))
		IF (el.type="Text") THEN
                      el.text.string = right(el.text.string, (len(el.text.string) - 2))
		END IF
                el = el.nextSelectedElement
	END WHILE
END IF
END MACRO

This macro finds all text elements that contain "cs", then loops through them and removes the two leftmost characters (which should be "cs"). This should work for your purposes if "cs" is always the two characters on the left.

 

If "cs" could appear anywhere within the text string, you may need a different, more robust approach. Let me know, hope this helps!

View solution in original post

1 REPLY 1

Try this script:

 

Macro Remove cs
DEFINE el as Element
Select if Text contains 'cs'

IF (exists(activeDoc.firstSelectedElement)) THEN
	el = activeDoc.firstSelectedElement
	WHILE (exists(el))
		IF (el.type="Text") THEN
                      el.text.string = right(el.text.string, (len(el.text.string) - 2))
		END IF
                el = el.nextSelectedElement
	END WHILE
END IF
END MACRO

This macro finds all text elements that contain "cs", then loops through them and removes the two leftmost characters (which should be "cs"). This should work for your purposes if "cs" is always the two characters on the left.

 

If "cs" could appear anywhere within the text string, you may need a different, more robust approach. Let me know, hope this helps!

Top Tags