Did you try changing the geometricBounds?
First of all I thank for ur kind reply.
I select the graphic Line object and tried to set the geometric bounds. But useless. I need to change the the length of the line.
Can u help?
Thanks and Regards,
As you can see in the object model, graphic lines have no length property, but they do have geometricBounds. So changing the length of a line is like changing the size of a text frame or rectangle using geometricBounds. Start a new document and place a vertical line. Then do this:
line = app.documents.graphicLines;
gb = line.geometricBounds;
gb += 6;
line.geometricBounds = gb;
The line is made a deeper -- how much deeper depends on your document's measurement units.
Yes.... You are right Peter....
Thanks a lot for your kind response..................
With warm regards,
1 person found this helpful
if you'll really need the length of a graphic linesome day. you've got to do a bit math as ID does not provide the length although it's shown in the UI.
You may use geometricBounds or pathPoint.anchor as below ...
var myPathPoints = app.activeDocument.graphicLines.paths.pathPoints;
//this is pythagoras, but you may use any other mathrule to solve ...
myLength = Math.sqrt(Math.pow(myPathPoints.anchor - myPathPoints.anchor, 2) + Math.pow(myPathPoints.anchor - myPathPoints.anchor, 2) )
Thanks a lot Hans... Your codes help me a lot...
With Best Regards,
I'm new to scripting in Indesign. How can I use this code in Indesign, let's say to display the length of graphical line in a textbox overlay.
Please post your request in the main forum.