• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

problem with graphicLine geometric

Participant ,
Feb 02, 2017 Feb 02, 2017

Copy link to clipboard

Copied

hi there,

i'm stuck with this problem.. i've created a line on page using JS.

var myLine;
myLine=app.activeDocument.graphicLines.add();

myLine.geometricBounds = ['200mm', '0mm', '200mm','300mm'];
myLine.strokeWeight ="8pt";

when i select the line on page, it gives X: 0mm, Y:198.589mm,  L:300mm

what i don't understand is why Y is not 200mm? How to make it 200mm.

Thank you.

TOPICS
Scripting

Views

592

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Guru , Feb 02, 2017 Feb 02, 2017

app.activeDocument.layoutWindows[0].transformReferencePoint =  LEFT_CENTER_ANCHOR;

HTH

Trevor

Votes

Translate

Translate
Guru ,
Feb 02, 2017 Feb 02, 2017

Copy link to clipboard

Copied

Can you spot the difference?

2017-02-03_09-16-09.png

2017-02-03_09-16-40.png

Which of the 9 squares is highlighted by you?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Feb 02, 2017 Feb 02, 2017

Copy link to clipboard

Copied

the top one..

anyway to use JS to set the default as bottom?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Feb 02, 2017 Feb 02, 2017

Copy link to clipboard

Copied

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Feb 02, 2017 Feb 02, 2017

Copy link to clipboard

Copied

Hi tpk1982

Sorry you are way off, this has nothing to do with math rounding.

There's a setting for which reference point of the control bounds are being used.

I'm trying to remember how to refer to it.

Click the right box in and look at the x value.

Trevor

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Feb 03, 2017 Feb 03, 2017

Copy link to clipboard

Copied

Thanks Trevor, maybe i oversight the requirement

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Feb 02, 2017 Feb 02, 2017

Copy link to clipboard

Copied

app.activeDocument.layoutWindows[0].transformReferencePoint =  LEFT_CENTER_ANCHOR;

HTH

Trevor

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Feb 03, 2017 Feb 03, 2017

Copy link to clipboard

Copied

LATEST

got it.. Thank you Trevor


app.activeDocument.layoutWindows[0].transformReferencePoint =  AnchorPoint.BOTTOM_LEFT_ANCHOR;

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Feb 02, 2017 Feb 02, 2017

Copy link to clipboard

Copied

use Math.round

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines