Page 1 of 1
Use of CADGroup Object example?
Posted: 01 Sep 2007, 01:42
by SLMaxwell68
Using the CAD Import .NET (pro/extended) library in C#...
Could I see a breif example on the proper use of the CADGroup object?
I have attempted adding entities to the group and the group to the converter - but the entities do not display within the drawing?
Posted: 03 Sep 2007, 11:00
by support
Hello!
<b>CADGroup</b> is not a visual object. That is why added entities could not be displayed.
We recommend to use classes <b>CADBlock</b> and <b>CADInsert</b>. Do you need an example?
Sergey.
Please post questions to the forum or write to
support@cadsofttools.com
Posted: 04 Sep 2007, 16:38
by SLMaxwell68
Yes please.
When testing the groups - we also tried the CADBlock objects without success. We are obviously not setting-up/using the Block object correctly as the results with this object were the same as with the group. We did not attempt to use the CADInsert object yet.
Examples of both/or either the Block and Insert would be very beneficial.
Thanks in advance,
Scott M.
Posted: 05 Sep 2007, 11:30
by support
Hello Scott,
Please try the following code:
Code: Select all
<font color="green">//add line</font id="green">
CADLine ln1 = <font color="blue">new</font id="blue"> CADLine();
ln1.Color = Color.Red;
ln1.Point = <font color="blue">new</font id="blue"> DPoint(10, 10, 0);
ln1.Point1 = <font color="blue">new</font id="blue"> DPoint(20, 20, 0);
ln1.Loaded(this.FCADImage.Converter);
<font color="blue">this</font id="blue">.FCADImage.Converter.OnCreate(ln1);
<font color="green">//add attdef</font id="green">
CADAttrib entAttrib = <font color="blue">new</font id="blue"> CADAttrib();
entAttrib.Tag = "Tag Faska";
entAttrib.Text = "Text Bolt";
<font color="blue">this</font id="blue">.FCADImage.Converter.Loads(entAttrib);
<font color="green">//add block</font id="green">
CADBlock bl1 = <font color="blue">new</font id="blue"> CADBlock();
bl1.Name = "MyBlock";
bl1.Color = Color.Red;
bl1.Visibility = <font color="blue">true</font id="blue">;
bl1.AddEntity(ln1);
<font color="blue">this</font id="blue">.FCADImage.Converter.Blocks.Add(bl1);
<font color="blue">this</font id="blue">.FCADImage.Converter.OnCreate(bl1);
<font color="blue">this</font id="blue">.FCADImage.Converter.Loads(bl1);
<font color="green">//add insert</font id="green">
CADInsert ins1 = <font color="blue">new</font id="blue"> CADInsert();
ins1.Angle = 130;
ins1.Block = bl1;
ins1.Point = <font color="blue">new</font id="blue"> DPoint(10, 10, 0);
ins1.Visibility = <font color="blue">true</font id="blue">;
ins1.AddEntity(entAttrib);
<font color="blue">this</font id="blue">.FCADImage.Converter.Entities.Add(ins1);
<font color="blue">this</font id="blue">.FCADImage.Converter.OnCreate(ins1);
<font color="blue">this</font id="blue">.FCADImage.Converter.Loads(ins1);
<font color="blue">this</font id="blue">.cadPictBox.Invalidate();
Sergey.
Please post questions to the forum or write to
support@cadsofttools.com
Posted: 11 Sep 2007, 18:34
by SLMaxwell68
Sergey,
Thank you for the example!!!
We were not linking the insert object correctly.
Very helpful!