cstRectangle?

Discuss and ask questions about CADEditorX and XML API.

Moderators: SDS, support, admin

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

cstRectangle?

Post by agvs » 06 Apr 2017, 04:55

Hello,
I have a question.
I know there are 'cstLine', 'cstCircle', and so on.
By the way, I want to add 'Rectangle' like above.
Do you have 'cstRectangle'?
Let me know.
Thanks,

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

Re: cstRectangle?

Post by support » 07 Apr 2017, 17:44

Hello,

XML API doesn't have cstRectangle object. To add a rectangle, you should use a closed polyline:

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<cadsofttools version="2">
<add>
    <cstLWPolyline>
        <SubEntities>
            <cstVertex Point="0,0"/>
            <cstVertex Point="20,0"/>
            <cstVertex Point="20,10"/>
            <cstVertex Point="0,10"/>
            <cstVertex Point="0,0"/>
        </SubEntities>
    </cstLWPolyline> 
</add>                                    
</cadsofttools>
Mikhail
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

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

Re: cstRectangle?

Post by agvs » 10 Apr 2017, 04:51

Thanks,
I applied your way for blocks.

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<cadsofttools version="2">
<add>
<cstSectionBlocks Name="BLOCKS" >
<SubEntities>
<cstBlock name="BTrace" >
<SubEntities>
<cstLWPolyline>
<cstVertex point="0,0"/>
<cstVertex point="150,0"/>
<cstVertex point="150,100"/>
<cstVertex point="0,100"/>
<cstVertex point="0,0"/>
</cstLWPolyline>
</SubEntities>
</cstBlock>
</SubEntities>
</cstSectionBlocks>
</add>
</cadsofttools>
but I got a message like "Unsupported Child cstLWPolyline".
How do I have to do in this situation?
Let me know!

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

Re: cstRectangle?

Post by support » 10 Apr 2017, 17:34

Hello,

You will have to add <SubEntities> node before and after <cstVertex> nodes:

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<cadsofttools version="2">
<add>
    <cstSectionBlocks Name="BLOCKS">
    <SubEntities>                     
        <cstBlock name="BTrace">
            <SubEntities>
                <cstLWPolyline>
                    <SubEntities>
                        <cstVertex point="0,0"/>
                        <cstVertex point="150,0"/>
                        <cstVertex point="150,100"/>
                        <cstVertex point="0,100"/>
                        <cstVertex point="0,0"/>        
                    </SubEntities>
                </cstLWPolyline>      
            </SubEntities>
        </cstBlock> 
    </SubEntities>
    </cstSectionBlocks>                              
</add>
</cadsofttools>
Mikhail
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

Post Reply