Anyway to check if a hatch pattern exist?

Anyway to check if a hatch pattern exist?

Anonymous
Not applicable
699 Views
3 Replies
Message 1 of 4

Anyway to check if a hatch pattern exist?

Anonymous
Not applicable

the code below returns eInvalidInput.

 

Acad::ErrorStatus es = pHatch->setPattern(AcDbHatch::kCustomDefined,szPattern);

it returns eInvalidInput

 

is there any way to check whether the Hatch Pattern exist in the current CAD envoriment?

 

0 Likes
700 Views
3 Replies
Replies (3)
Message 2 of 4

Hallex
Advisor
Advisor

Take a look at this article

http://through-the-interface.typepad.com/through_the_interface/2012/03/getting-the-list-of-hatch-pat...

_____________________________________
C6309D9E0751D165D0934D0621DFF27919
0 Likes
Message 3 of 4

Anonymous
Not applicable

thanks a lot, the solution is on DotNet Framework, but I work on C++. 

0 Likes
Message 4 of 4

Balaji_Ram
Alumni
Alumni

Sorry, There is no ObjectARX API to directly retrieve the list of available hatch patterns.

 

However, Hatch patterns are stored in .PAT files(acad.pat and acadiso.pat are hatch pattern files supplied by AutoCAD). .PAT files are text files and you can read them directly.

 

Since all the hatch patterns definition use the same format, you can get a list of hatch patterns by directly reading the .PAT files. For description of hatch pattern definitions, please refer to http://exchange.autodesk.com/autocadarchitecture/enu/online-help/ARCHDESK/2012/enu/pages/WS73099cc14...

 

Also, since your original question was about checking if a hatch pattern exists, will it not do if you simply check for "eInvalidInput" by providing a hatch name to test if it is a valid one ?



Balaji
Developer Technical Services
Autodesk Developer Network

0 Likes