Skip to main content
1-Visitor
January 24, 2019
Solved

Arbortext Isodraw Macro Text edit

  • January 24, 2019
  • 1 reply
  • 2922 views

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???

 

 

Best answer by kleind

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!

1 reply

kleind1-VisitorAnswer
1-Visitor
February 21, 2019

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!