Skip to main content
Inspiring
October 7, 2011
Answered

How to make guides using SDK methods?

  • October 7, 2011
  • 2 replies
  • 1108 views

Hi All,

I have a query. How can we make guides through SDK functions calls..? I was unable to find anything like it.. Please help.. There is no piece of code in the samples too..

Thanks!

This topic has been closed for replies.
Correct answer

Hi,

Of course, once you have created the path with sAIArt->New(...), nothing appears, you have to indicate the coordinates for each point of your future guide.

For an horizontal guide, you write something like

AIPathSegment S;

AIArtHandle MyPath;

error = sAIArt->NewArt( kPathArt, kPlaceAboveAll, nil, &MyPath);

//The guide will have two points.

error = sPath->SetPathSegmentCount(MyPath, 2);

//Position of the first point.

S.p.h=10;

S.p.v=120;

S.in=S.out=S.p;

error=sAIPath->SetPathSegments(MyPath, 0, 1, &S);

//Position of the second point.

S.p.h=800;

S.in=S.out=S.p;

error=sAIPath->SetPathSegments(MyPath, 1, 1, &S);

//The path will be a guide.

error = sAIPath->SetPathGuide(MyPath, true);

//This time, an horizontal guide will be created and will appear from (10 ; 120) to (800 ; 120).

JLG.

2 replies

October 7, 2011

Hi,

To create a guide, I use the AIPathSuite.

First, I create a path with something like

error = sAIArt->NewArt( kPathArt, kPlaceAboveAll, nil, &MyPath);

Then use SetPathGuide to transform this path into a guide.

error = sAIPath->SetPathGuide(MyPath, true);

Very simple.

JLG.

poortip87Author
Inspiring
October 10, 2011

Hi..

Thanks for the reply.. I had tried this before, but I couldn't see any guides... I want to make 4 of them, 2 horizontal & 2 vertical... Also, how can I mention any co-ordinates in these lines of code..??

Correct answer
October 10, 2011

Hi,

Of course, once you have created the path with sAIArt->New(...), nothing appears, you have to indicate the coordinates for each point of your future guide.

For an horizontal guide, you write something like

AIPathSegment S;

AIArtHandle MyPath;

error = sAIArt->NewArt( kPathArt, kPlaceAboveAll, nil, &MyPath);

//The guide will have two points.

error = sPath->SetPathSegmentCount(MyPath, 2);

//Position of the first point.

S.p.h=10;

S.p.v=120;

S.in=S.out=S.p;

error=sAIPath->SetPathSegments(MyPath, 0, 1, &S);

//Position of the second point.

S.p.h=800;

S.in=S.out=S.p;

error=sAIPath->SetPathSegments(MyPath, 1, 1, &S);

//The path will be a guide.

error = sAIPath->SetPathGuide(MyPath, true);

//This time, an horizontal guide will be created and will appear from (10 ; 120) to (800 ; 120).

JLG.

October 7, 2011

I believe its a flag you can set on any path.