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

How To Distinguish Line,circle and Arcs in Current Document

Community Beginner ,
Aug 24, 2017 Aug 24, 2017

Copy link to clipboard

Copied

Dear Friends,

     I am having path Arts in the current document.

     I read all the Path Arts by the Following code.

ASErr error=kNoErr;

AIArtSet artSet = NULL;

AIArtSet SelectartSet=NULL;

AIArtSpec specs[1] = {{kPathArt,0,0}};

error = sAIArtSet->NewArtSet(&artSet);

error = sAIArtSet->MatchingArtSet(specs, 1, artSet);

size_t numArts = 0;

sAIArtSet->CountArtSet(artSet, &numArts);

      Is It possible to find the Art is Circle or Line or Arc?.

      if it is Possible,give me your suggestions.

Thank you Friends,

Nathan

TOPICS
SDK

Views

1.8K

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
Adobe
Guide ,
Aug 25, 2017 Aug 25, 2017

Copy link to clipboard

Copied

No, there's no help for you there I'm afraid. You'd have to do the math to determine what you're looking at -- which is not something I'd recommend frankly The best you can usually do is to iterate over the points and see if any of them are bezier or not (i.e. are thei n & out points the same as p?) -- that at least lets you rule our circle or arc.


But no, there's no classification. The AIPathSegment design encompasses all and does not try to classify; frankly, it would be very difficult to do it (personally, I don't think it's feasible).

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 ,
Aug 27, 2017 Aug 27, 2017

Copy link to clipboard

Copied

Cumon, mister President Patterson, it's as easy as 1 2 3 🙂

Line - 2 points, zero area; circle - check the relation between length and area(you know, 2pi*r, pi*r*r); arc - 2 points, the same, boring.

I'm playing now with sine curves,this is a real pain in the back fun.

sine curves.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 Beginner ,
Aug 27, 2017 Aug 27, 2017

Copy link to clipboard

Copied

Dear Friend,

   Thank you For your Suggestion.

    please explain more about how to calculate the Area(If Circle means Area= pi*r*r,How to find r here), And How to distinguish between Line And Arc.

 

Thank you friend,

Nathan.

 

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
Advocate ,
Aug 28, 2017 Aug 28, 2017

Copy link to clipboard

Copied

As Mr Patterson says it is not simple.

You say you want to classify art as line, arc or circle, but a single piece of art can be made up of thousands of points.

What is a circle? Is an ellipse a circle? How about an ellipse whose width is 100 mm and height is 99.9 mm?

What is an arc? You could approximate an arc with lots of short straight line segments. Is that an arc?

What is a path that includes both straight line and bezier segments?

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 ,
Aug 31, 2017 Aug 31, 2017

Copy link to clipboard

Copied

From the theoretical point of view, circles and real arcs (as well as sine curves) can not be drawn using cubic bezier curves (Michael Goldapp, "Approximation of circular arcs by cubic polynomials").

The radial error in this approximation by bezier curves will be about 0.0273% of the circle's radius.

So the answer could be: circles and arcs can not be "distinguished" as it's not possible to draw them in illustrator.

But we live in the real world. So the keyword here is tolerance.

circle_arc.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 Beginner ,
Sep 01, 2017 Sep 01, 2017

Copy link to clipboard

Copied

Dear Friend,

    Thank You For Your Suggestion.

     I want to create My Own DXF(consist of Lines and Arcs) for the Current Document in the illustrator By Using illustrator API..

     Is Any method availabe in Illustrator API to get the Curve points which is to be used to Create DXF or Any mathematic formulae available to calculate line and arc properties From Bezier Points or Segments.

    AIPathSegment segment;

   sAIPath->GetPathSegments( artCurrent, nCurSegment, 1, &segment );

   AIRealBezier bezier;

  sAIPath->GetPathBezier(artCurrent, nCurSegment,&bezier);

  Thank You Friend,

  Nathan.

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
Advocate ,
Sep 01, 2017 Sep 01, 2017

Copy link to clipboard

Copied

Why don't you just use AIDocument::WriteDocument to save the current document as DXF?

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 Beginner ,
Sep 01, 2017 Sep 01, 2017

Copy link to clipboard

Copied

Dear Friend,

   Thank you For Your Suggestion.

   I want to create DXF as R12 Version.

   If I try to save as DXF manually illustrator shows the DXF version From R13.please see the image given below.

How to save the DXF as R12 by code.Is any options available?.

Thank you Friend,

Nathan

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
Advocate ,
Sep 01, 2017 Sep 01, 2017

Copy link to clipboard

Copied

The earliest version supported by Illustrator is R13. Why do you want to save as a 25 year old file format?

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 Beginner ,
Sep 01, 2017 Sep 01, 2017

Copy link to clipboard

Copied

Dear Friend,

   We are having a  plugin that exports DXF as R12 Format,Now I want to implement the Same for the latest versions of illustrator.

   So only i want to save it as R12 Format.

   please give your Suggestion

Thank You Friend,

Nathan

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
Advocate ,
Sep 01, 2017 Sep 01, 2017

Copy link to clipboard

Copied

What do you do with the exported R12 DXF files? Are they used by software that is so old it can't read any newer version?

Where did the old plugin come from? Do you have the source code?

If you really want to export DXF R12 from current versions of Illustrator, it would probably be easier to export as R13 and then write code to convert that to R12 rather than trying to write code to convert an Illustrator document to DXF R12. Do you know what the difference is between R12 and R13 DXF formats?

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 Beginner ,
Sep 07, 2017 Sep 07, 2017

Copy link to clipboard

Copied

Dear Friend,

  Thank You For Your Suggestion..

  We don't have source code.

  How to save as R13 version DXF by code.If I use AIDocument::WriteDocument then how to set R13 Version.

Thank You Friend,

Nathan.

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
Advocate ,
Sep 08, 2017 Sep 08, 2017

Copy link to clipboard

Copied

You should be able to use DxfDwgExportPrefs (AIDxfDwgPrefs.h) in an action manager PlayActionEvent call in the same way as  PSDExportPrefs. It sounds like PSDExportPrefs doesn't work anymore. I have never tried to use either:

Re: PSDExportPrefs options fails to work in CS5

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 Beginner ,
Sep 08, 2017 Sep 08, 2017

Copy link to clipboard

Copied

Dear Friend,

     Thank You For Your Suggestion..

     I tried AIDxfDwgPrefs in Adobe Illustrator CC version.  But it doesn't work.

    Is it possible to set the version by Using AIActionSetInteger Method.?.If it possible what is the versionKey to DXF Export Operation. see  the following code.

   sAIActionManager->AIActionSetInteger(paramValueRef, 'versionKey', eR13);

  please give your Suggestion.

Thank You Friend,

Nathan

   

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
Advocate ,
Sep 08, 2017 Sep 08, 2017

Copy link to clipboard

Copied

I don't think you can set the version using the action manager. I tried saving two actions, one saving as R13 and the other saving as R14, but they don't include any version settings and when you replay the actions, they just use whatever the last setting was. You might be able to get it to work by overwriting the DXF preference before you do the save (should really restore the previous setting afterwards):

AIPreference::PutIntegerPreference("DxfDwg","ExportAutoCADVersion",0);

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 Beginner ,
Sep 10, 2017 Sep 10, 2017

Copy link to clipboard

Copied

LATEST

Dear Friend,

  Thank you For You help.

  Its Works Fine to save in R13 Version.

   And Im having a doubt,Is there any options available to omit the Fill and Text Arts in the saving DXF File.Or Any options Available To Undo The number of Operation.That is  I remove All the Fills and Texts in the Current Document and Save it as DXF and Undo(Retain the Removed Fills and Text)?

Thank you Friend,

Nathan.

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 Beginner ,
Aug 28, 2017 Aug 28, 2017

Copy link to clipboard

Copied

Dear Friend,

     Thank you For Your Suggestion.

     I distinguish Arc and Line by as you said

     if in & out points the same as p then it is Line

     else it is Curve(Arc,Circle or Ellipse).

   

     How to Calculate the Arc's Centerpoint,Radius,Start Angle and End Angle Using p and in and out Points.

     please give your suggestion.

    Thank You Friend,

     Nathan

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