Block

Discuss and ask questions about CADEditorX and XML API.

Moderators: admin, support, SDS

Block

Postby agvs » 31 Oct 2016, 02:14

Hi,
I'd like to make a block which consists of line, circle, and hatch.(not separate, thosre are one for block)
I tried to do that, but it was difficult with hatch for me.
Let me know how to do design for block?
Below source is my source.
Please, check it.
"\n <add>" +
"\n<cstSectionBlocks Name=\"BLOCKS\" HandleSave=\"@4\">" +
"\n<SubEntities>"+
"\n<cstBlock name=\"BSPoint\">"+
"\n<SubEntities>"+
"\n<cstCircle point=\"0,0,0\" radius=\"5\" HandleSave=\"@2\" />"+
"\n<cstLine point=\"0,0,0\" point1=\"5,0,0\" HandleSave=\"@3\" />" +
"\n</SubEntities>"+
"\n</cstBlock>"+
"\n</SubEntities>"+
"\n</cstSectionBlocks>"+
"\n<cstInsert blockname=\"BSPoint\" point=\"0,50.678,0\" layer=\"Layer2\" />" +
"\n</add>"+
agvs
 
Posts: 30
Joined: 16 Jun 2016, 09:10

Re: Block

Postby support » 02 Nov 2016, 15:10

Hello,

To create a hatch inside a block, you should use cstCurvePolygon object which represents a hatch with solid filling. Have a look at the code example below.

Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<cadsofttools version="2">   
   <add>
       <cstSectionBlocks Name="BLOCKS">
        <SubEntities>
           <cstBlock name="Block1">
            <SubEntities>
                <cstCurvePolygon Color="0;3;" SolidFill="True">
                   <Boundaries>
                    <Boundary Flags="1">
                       <csthArc CenterPoint="0,0" Radius="5" StartParam="0" EndParam="360"/>
                        <cstLine Point="0,0" Point1="5,0"/>       
                    </Boundary>
                    </Boundaries>                                           
                </cstCurvePolygon> 
            </SubEntities>
           </cstBlock>
        </SubEntities>
       </cstSectionBlocks>           
       <cstInsert blockname="Block1" Point="0,50,0" Layer="Layer_Block"/>
   </add>
<FitToSize/>
</cadsofttools> 

Notice that this code uses a circular arc (csthArc) instead of cstCircle in the hatch boundary path.


Mikhail
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
support
 
Posts: 2754
Joined: 30 Mar 2005, 08:36


Return to CADEditorX

Who is online

Users browsing this forum: No registered users and 1 guest