How to add line, text, block, layer, etc.

<< Click to Display Table of Contents >>

Navigation:  How To >

How to add line, text, block, layer, etc.

Such entities as lines, texts, mtexts, blocks and inserts and others as well as invisible objects like layers and styles are called Classes in CAD XML reference. They can be added by calling the add instruction that accepts CAD Drawing XML Structure as a child parameter.

There are a lot of examples of adding particular classes in the Classes section of the XML examples.

To add text and line, execute the following XML:

<?xml version="1.0" encoding="utf-8"?>
<cadsofttools version="2">
 <add>
   <cstText Text="CADSoftTools" Point="0.5,0.5" Height="1"/>
   <cstLine point="0,0,0" Point1="10,0,0" color="0;1;"/>                
 </add>
 <fittosize/>
</cadsofttools>    

 

To add a new layer, execute the following XML:

<?xml version="1.0" encoding="UTF-8"?>
<cadsofttools version="2">
 <add>
   <cstSectionTables Name="TABLES">
     <SubEntities>
       <cstTable Name="LAYER">
         <SubEntities>
           <cstLayer Name="New_Layer" color="0;3;"/>
         </SubEntities>
       </cstTable>
     </SubEntities>              
   </cstSectionTables>
 </add>
</cadsofttools>    

 

To add a block, execute the following XML:

<?xml version="1.0" encoding="utf-8"?>
<cadsofttools version="2">
 <add>
   <cstSectionBlocks Name="BLOCKS">
     <SubEntities>
       <cstBlock name="block1">
         <SubEntities>
           <cstLine point="0,0,0" point1="50,0,0" />
           <cstText point="0,3,0" text="This is a block" height="3" />
         </SubEntities>
       </cstBlock>
     </SubEntities>
   </cstSectionBlocks>
   <!-- Add entities Model -->
   <cstInsert blockname="block1" point="0,50,0" layer="Layer2" />
 </add>
 <fittosize />
</cadsofttools>

Go to CADEditorX