How to customize CADEditorX?
Moderators: SDS, support, admin
How to customize CADEditorX?
I don't see how to customize/interact with CADEditorX programmatically under VisualStudio 2012. For example,
1) how do I add a button and create an associated event?
2) How do I iterate through all entities?
3) How do I view attributes of a block?
1) how do I add a button and create an associated event?
2) How do I iterate through all entities?
3) How do I view attributes of a block?
Re: How to customize CADEditorX?
Hello,
CADEditorX provides an easy-to-use API based on the XML format. Actually, an API contains a single ProcessXML() function that takes some XML string as an argument, processes it and returns some result in XML format. The input XML string contains a set of XML instructions. In order to perform some operation(s), you should include the corresponding XML instruction(s) in the input XML string.
For example, to retrieve the drawing data, you should process <get/> instruction. In other words, you need to call the CADEditorX.ProcessXML() function passing the following XML string:
The ProcessXML() function will return the drawing data in XML format. Then you need to parse the output XML and extract the needed information. You don't have to iterate through the entities, <get/> instruction can extract an information about the object specified by its path in the Converter. For example, to get a block by its name, process the following XML string:
where BLOCKS specifies the BLOCKS section in DWG/DXF file, SMOKE-DETECTOR - the block name. The block attributes can be found in the output XML as <cstAttdef/> nodes.
Do you need to add a button to CADEditorX toolbar? What events do you need?
Mikhail
CADEditorX provides an easy-to-use API based on the XML format. Actually, an API contains a single ProcessXML() function that takes some XML string as an argument, processes it and returns some result in XML format. The input XML string contains a set of XML instructions. In order to perform some operation(s), you should include the corresponding XML instruction(s) in the input XML string.
For example, to retrieve the drawing data, you should process <get/> instruction. In other words, you need to call the CADEditorX.ProcessXML() function passing the following XML string:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<cadsofttools version="2">
<get/>
</cadsofttools>
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<cadsofttools version="2">
<get PathName="BLOCKS;SMOKE-DETECTOR"/>
</cadsofttools>
Do you need to add a button to CADEditorX toolbar? What events do you need?
Mikhail
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support
Re: How to customize CADEditorX?
I will need a button called "Scan" and an event HandleScan(object sender, object data).
Re: How to customize CADEditorX?
Hello,
It is not possible to add user-defined buttons to CADEditorX toolbars. You can create a new toolbar and add some predefined buttons to it using "Ribbon editor" dialog box (right-click on the Ribbon > Customize ribbon).
Mikhail
It is not possible to add user-defined buttons to CADEditorX toolbars. You can create a new toolbar and add some predefined buttons to it using "Ribbon editor" dialog box (right-click on the Ribbon > Customize ribbon).
Mikhail
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support
Re: How to customize CADEditorX?
Hi, I just starting CADEditorX
Prev using CAD .Net examples is very easy.
How to:
1. Hide all toolbar/menu/etc only to show the Image only like CAD .Net ImageControl
2. How to make the Image readonly user can only see/zoom no edit
3. I'm using trial version when I click ActiveX properties nothing happen is this inteded ? or something we could do in the ActiveX properties
4. How to query the entities like in CAD .Net imagecontrol.convert, I did not find this function in popup menu axSgCADEditor1 (CADEditorX)
Share the light please
Thank
Sen
Prev using CAD .Net examples is very easy.
How to:
1. Hide all toolbar/menu/etc only to show the Image only like CAD .Net ImageControl
2. How to make the Image readonly user can only see/zoom no edit
3. I'm using trial version when I click ActiveX properties nothing happen is this inteded ? or something we could do in the ActiveX properties
4. How to query the entities like in CAD .Net imagecontrol.convert, I did not find this function in popup menu axSgCADEditor1 (CADEditorX)
Share the light please
Thank
Sen
Re: How to customize CADEditorX?
Hello Sen,
To hide all CADEditorX UI elements, use the HideAllInterface command:
To make the loaded drawing file(s) read-only, you should switch to the Viewer mode:
As for the ActiveX -Properties item in the control context menu which is displayed in Visual Studio designer, this item actually does nothing.
To query the entities, you need to use the XML instruction <get> which allows to extract the drawing data in the XML format:
Let's say, you want to query only LINE and TEXT entities. In this case add the corresponding entity filters to the <get> instruction:
Mikhail
To hide all CADEditorX UI elements, use the HideAllInterface command:
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<cadsofttools version="2">
<command text="HideAllInterface"/>
</cadsofttools>
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<cadsofttools version="2">
<command text="Viewer"/>
</cadsofttools>
To query the entities, you need to use the XML instruction <get> which allows to extract the drawing data in the XML format:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<cadsofttools version="2">
<get/>
</cadsofttools>
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<cadsofttools version="2">
<get>
<cstLine/>
<cstText/>
</get>
</cadsofttools>
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support
Re: How to customize CADEditorX?
Thank for your information.
About no.4 since using XML to interact is new to us, how to do CADImage.Convert.Entitites in CADEditorX ?
I want to get all the entities (very simple in CAD.NET), and some entities inside the block I want to change the text and color how we do this ?
About no.4 since using XML to interact is new to us, how to do CADImage.Convert.Entitites in CADEditorX ?
I want to get all the entities (very simple in CAD.NET), and some entities inside the block I want to change the text and color how we do this ?
Re: How to customize CADEditorX?
Hello Sen,
To query all entities in the Model space you can use the following XML code:
Mikhail
To query all entities in the Model space you can use the following XML code:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<cadsofttools version="2">
<get PathName="BLOCKS;*MODEL_SPACE"/>
</cadsofttools>
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support