Skip to main content
Participant
April 14, 2009
Question

Moving objects on a graph

  • April 14, 2009
  • 1 reply
  • 935 views

I'm developing an application in C# that will let users create bar chart graphs using Illustrator. The client wants the value of individual bars to be displayed at the end of each bar. I want to do this as a text string and will need to move those strings around so they end up in the right place. Can this be done? How can I move objects around?

This topic has been closed for replies.

1 reply

A. Patterson
Inspiring
April 15, 2009

I've never developed in C# for Illustrator -- do you still tap into the suite-based API that you would with C/C++? If so, moving text is fairly straight forward. If you're talking about point text, you just ask the text for its anchor point (AITextFrame.h) and then figure out where you want to move it. Calculate the trasformation you'd need and then divide that by the scale attached to the text object (ITextFrame::GetMatrix & AIRealMath::AIRealMatrixGetScale). Then build a matrix (AIRealMath::AIRealMatrixSetTranslate) and apply that to the text objct (AITransformArt::TransformArt).

Naturally, this all assumes you're using the C/C++ SDK. If you're not, I'm not sure what tools are available to you, but I'd surprised if moving text wasn't one of them.

Participant
April 17, 2009

Thanks for the information. What I'll probably do is use MS Visual C++ to write a wrapper around the Illustrator SDK which will give me a .net DLL that I can then compile into my C# graphing application.