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

How can set background of rectangle display the same a triangle?

Enthusiast ,
May 31, 2018 May 31, 2018

Copy link to clipboard

Copied

This is a example:

Untitled.png

i can using fillColor to set background, but how can display the same a triangle (refer image)?

TOPICS
Scripting

Views

454

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
People's Champ ,
May 31, 2018 May 31, 2018

Copy link to clipboard

Copied

If you mean using patterns such as Illustrator does, I don't think you can.

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
Community Expert ,
May 31, 2018 May 31, 2018

Copy link to clipboard

Copied

No patterns, but a clipping mask can do it. "Clipping mask" is Illustrator terminology; in InDesign you'd manually copy the triangle and paste it into the white filled rectangle.

In scripting terminology, that is what the "rectangles", "ovals", "text frames", "polygons" and "graphic lines" properties of a single rectangle are for: these items are contained inside the rectangle. So create one such object manually and then inspect how it is constructed in the DOM.

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
People's Champ ,
May 31, 2018 May 31, 2018

Copy link to clipboard

Copied

Once that said, I am pretty certain Marc did some experimentations with "patterns" inside InDesign but I can't find it back.

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
Enthusiast ,
May 31, 2018 May 31, 2018

Copy link to clipboard

Copied

This code can create a triangle:

        oRec = oDocument.Rectangles.Add()

        oRec.FillColor = oDocument.Swatches(7)

        oRec.ConvertShape(InDesign.idConvertShapeOptions.idConvertToTriangle)

        oRec.RotationAngle = 270

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
Community Expert ,
Jun 01, 2018 Jun 01, 2018

Copy link to clipboard

Copied

Hi,

I still don't get what you want to achieve.

Can you post a screenshot where you fake the result?

If you want a custom pattern and use it as fill: InDesign has no feature for that. Illustrator has.

With InDesign you have to repeat a shape in various ways.

You also could look into PostScript programming code and generate a EPS file with a pattern and place that to fill a shape.

Found this: Postscript programming

Regards,
Uwe

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
Enthusiast ,
Jun 01, 2018 Jun 01, 2018

Copy link to clipboard

Copied

This is a sample indd file:

Dropbox - Untitled-4.indd

I can create a triangle by code:

        oRec = oDocument.Rectangles.Add()

        oRec.FillColor = oDocument.Swatches(7)

        oRec.ConvertShape(InDesign.idConvertShapeOptions.idConvertToTriangle)

        oRec.RotationAngle = 270.

My problem is setting corner the same file sample.?

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
Community Expert ,
Jun 01, 2018 Jun 01, 2018

Copy link to clipboard

Copied

daitranthanhoa  wrote

My problem is setting corner the same file sample.?

Yeah that needs more words.

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
Enthusiast ,
Jun 01, 2018 Jun 01, 2018

Copy link to clipboard

Copied

you can refer file  example at: Dropbox - Untitled-4.indd

i want set Radius of 3 corners.

Untitled.png

i try using CornerOption = Rounded, but it still not the same example .

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
Enthusiast ,
Jun 01, 2018 Jun 01, 2018

Copy link to clipboard

Copied

Full my code:

Dim oRec = oDocument.Rectangles.Add()

        oRec.FillColor = oDocument.Swatches(7)

        oRec.ConvertShape(InDesign.idConvertShapeOptions.idConvertToTriangle, 100, 100, 4)

        oRec.RotationAngle = 270

        oRec.TopLeftCornerOption = 1667592804

        oRec.TopRightCornerOption = 1667592804

        oRec.BottomLeftCornerOption = 1667592804

        oRec.BottomRightCornerOption = 1667592804

Untitled.png

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
Community Expert ,
Jun 01, 2018 Jun 01, 2018

Copy link to clipboard

Copied

Hm. I'd wish InDesign had a PostScript editing interface like FreeHand once had for generating PostScript patterns*.

Also found this:

Tiling in PostScript and METAFONT – Escher’s wink

Kees van der Laan

http://www.ntg.nl/maps/19/12.pdf

Regards,
Uwe

* not really. You can do very dangerous things with a interface like this.

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
People's Champ ,
Jun 01, 2018 Jun 01, 2018

Copy link to clipboard

Copied

LATEST

Looks like to me you wouldn't expect such a specific result from "generic" methods or properties. You would probably need to set your own geometry here.

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