How to apply(coding) 'PathName'?

Discuss and ask questions about CADEditorX and XML API.

Moderators: SDS, support, admin

Post Reply
agvs
Posts: 30
Joined: 16 Jun 2016, 11:10

How to apply(coding) 'PathName'?

Post by agvs » 28 Oct 2016, 05:24

I'm trying to test to get information about entities in EditorX after reading the help description("How to get information about entities").
By the way, I can't understand "PathName".
What’s meaning of "BLOCKS;*PAPER_SPACE;" in PathName?
Can you show me an example for PathName of 'get' with explanation?

the below source is my source
Process(
"\n<get Handle=\"@4\" />"+//<get PathName="BLOCKS;*PAPER_SPACE;"/>,@4 is block object

);
There was an error in result of XML.
Can you give me advice?

support
Posts: 3253
Joined: 30 Mar 2005, 11:36
Contact:

Re: How to apply(coding) 'PathName'?

Post by support » 31 Oct 2016, 18:47

Hello,

PathName means a path to the object in the drawing database. If you open a Structure window in CADEditorX (Viewer -> CAD Image -> Structure), you will see that a drawing consists of several sections: HEADER, TABLES, BLOCKS, ENTITIES, OBJECTS. For example, the BLOCKS section contains an entry for each block reference in the drawing. Expand this section in the Structure window and you will see the block definitions used in the drawing.

Speaking of "BLOCKS;*PAPER_SPACE;", it denotes a path to the paperspace block for the first drawing layout that comes after the Model. Let's say, a drawing has two layouts: Model and Layout1, in this case "BLOCKS;*PAPER_SPACE;" is a path to the paperspace block for Layout1. If you have several layouts in Paper space, the paperspace block paths for these layouts will be as follows:

"BLOCKS;*PAPER_SPACE;" - Layout1,
"BLOCKS;*PAPER_SPACE1;" - Layout2,
"BLOCKS;*PAPER_SPACE2;" - Layout3,
etc.

Calling the Get instruction with PathName allows to retrieve information about a specified object in the drawing database. Let's say, you want to get information about entities that make up a block with name Block1. Then you should process the following XML query:

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<cadsofttools version="2">
    <get PathName="BLOCKS;Block1;"/>
</cadsofttools>
The OnProcess event will return information about the entities that make up this block in the XML format. If the block with the given name doesn't exist, the output XML string will contain the error message:

Code: Select all

<Errors>
  <Error message="Object with handle BLOCKS;Block1; not found" Position="10,3"/>
</Errors>
Mikhail
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

Post Reply