Skip to main content
ソンヴ84888178
Participant
September 19, 2018
Question

How to create envolope Text in C# with ExecuteMenuCommand()

  • September 19, 2018
  • 2 replies
  • 943 views

Hello i have a problem in my code

i want to envelope text in c# but it not working add row  illuApp.ExecuteMenuCommand("expandStyle");

how to fix it ?? please help me!!!!!

Illustrator.Application illuApp = new Illustrator.Application();

            Illustrator.Document illuDoc = illuApp.Documents.Add();

            var content = illuDoc.TextFrames.Add();

            content.Contents = "Hello";

            content.Top = 500;

            content.Left = 300;

            content.Name = "Text";

            content.TextRange.CharacterAttributes.Size = 100;

            content.Selected = true;

            content.CreateOutline();

            illuApp.ExecuteMenuCommand("group");

            illuApp.ExecuteMenuCommand("Live Deform Wave");

            illuApp.ExecuteMenuCommand("expandStyle");// Not working

This topic has been closed for replies.

2 replies

ソンヴ84888178
Participant
September 21, 2018
i have changed my code and now it run good .
but i don't know how to get the   <Dict data="B Rotate 0 R DeformVert 0 R DeformHoriz 0.5 I DeformStyle 9 R DeformValue 0. 85 "/>
i'm using adobe illustrator cc 2018 .
can you show me how to get dict data above to apply another  Adobe Deform

            StringBuilder stb = new StringBuilder();
            stb.Append("<LiveEffect name = \"Adobe Deform\">");

            stb.Append("<Dict data=\"B Rotate 0 R DeformVert 0 R DeformHoriz 0.5 I DeformStyle 9 R DeformValue 0.85 \"/>");    //                    How to know dict data here ?????????????????????????????????????????????????

            stb.Append("</LiveEffect>");
            try
            {
                content.ApplyEffect(stb.ToString());
                illuApp.Redraw();
            }
            catch (Exception ex)
            {
                Debug.WriteLine("Error :" + ex);
            }

CarlosCanto
Community Expert
Community Expert
September 21, 2018

check this thread where we explain how to get the right xml strings

Re: PageItem.applyEffect(LiveEffectXML)

CarlosCanto
Community Expert
Community Expert
September 20, 2018

Hello,

as you have discovered, if you use executeMenuCommand you'll get the Effect Dialog, but there's no command to dismiss it. You have to apply the effect on the fly, then expand appearance.

I don't know C# but here's how to do it with javascript.

// apply wave effect

// carlos canto

// https://forums.adobe.com/thread/2537108

var idoc = app.activeDocument;

var p = idoc.selection[0];

// apply wave effect

xmlstring = '<LiveEffect name="Adobe Deform"><Dict data="B Rotate 0 R DeformVert 0 R DeformHoriz 0.5 I DeformStyle 9 R DeformValue 0.85 "/></LiveEffect>';

p.applyEffect(xmlstring);

app.redraw();

// expand appearance

//app.executeMenuCommand('expandStyle');