Ray,
You need to add
AC_DrawingName to your parameter list - this is one of those undocumented blue optional parameters LiHigh and Frank are refering to. Usually the blue optionals are in the GS library documentation HTML files on their website, but they seem to have forgotten to include any documentation on the new Drawing Title subtypes. If it is there i can't find it anyway so I too would be interested to know how LiHigh found them!
Anyway this new parameter will actually return the drawing name as a string to use in your script. The autotext <DRAWINGNAME> does not work like that .. as far as the script is concerned it is literally those characters, it is only after the script is run and the object displayed that AC recognises that combination of characters as an autotext function and converts them. This is why the line remains a constant length ... it is the length of the characters <DRAWINGNAME>.
Below is the script i've used for part of our title - this finds the width of the drawing name and sets the width of the drawing title lines to match.
fjmt_mrk_len1=STW(
AC_DrawingName)*(A_/1000)
LINE2 fjmt_mrk_rad1*2,-fjmt_mrk_rad1,fjmt_mrk_len1+fjmt_mrk_rad1*2+fjmt_mrk_txtoffset1,-fjmt_mrk_rad1
CIRCLE2 fjmt_mrk_rad1,-fjmt_mrk_rad1,fjmt_mrk_rad1
I've also attached our object as it stands. Its still a work in progress - for example it sets the title width based on the drawing name only. In practice this should always be the longest string but when its finished it will determine what string (Drawing Name, Scale ..) is longest and use that length. Anyway maybe it will help you.
Parameter names are a bit long i know but we like to put
fjmt
at the front of ours as most of our objects are just tweaked when required and this helps distinguish them from other peoples code
HTH
cheers,
Owen Sharp
Design Technology Manager
fjmt | francis-jones morehen thorp
iMac 27" i7 2.93Ghz | 32GB RAM | OS 10.10 | Since AC5