Discuss and ask questions about CADEditorX and XML API.

Moderators: admin, support, SDS

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


Post by agvs » 31 Oct 2016, 04:14

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<cstBlock name=\"BSPoint\">"+
"\n<cstCircle point=\"0,0,0\" radius=\"5\" HandleSave=\"@2\" />"+
"\n<cstLine point=\"0,0,0\" point1=\"5,0,0\" HandleSave=\"@3\" />" +
"\n<cstInsert blockname=\"BSPoint\" point=\"0,50.678,0\" layer=\"Layer2\" />" +

Posts: 2834
Joined: 30 Mar 2005, 11:36

Re: Block

Post by support » 02 Nov 2016, 17:10


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">   
    	<cstSectionBlocks Name="BLOCKS">
        	<cstBlock name="Block1">
                <cstCurvePolygon Color="0;3;" SolidFill="True">
                    <Boundary Flags="1">
                    	<csthArc CenterPoint="0,0" Radius="5" StartParam="0" EndParam="360"/>
                        <cstLine Point="0,0" Point1="5,0"/>       
    	<cstInsert blockname="Block1" Point="0,50,0" Layer="Layer_Block"/>
Notice that this code uses a circular arc (csthArc) instead of cstCircle in the hatch boundary path.

Technical Support E-mail:
Chat support on Skype:

Post Reply