Page 1 of 1
Change color
Posted: 28 Mar 2007, 17:07
by nico28
Hi.
I need to change the color of all elements in my DXF.
Example : all lines, circles, texts, ... , in Red.
How can i do that ?
Posted: 28 Mar 2007, 17:27
by nico28
I'am using CADImport.NET
Posted: 30 Mar 2007, 11:17
by support
Hello Nico!
Please use the following code (it is based on Viewer demo, find it in the ..\cadimportnet\sources\Viewer\.. folder):
Code: Select all
<font color="blue">private void</font id="blue"> btnChgColor_Click(<font color="blue">object</font id="blue"> sender, System.EventArgs e)
{
<font color="blue">if</font id="blue">(<font color="blue">this</font id="blue">.FCADImage == <font color="blue">null</font id="blue">) <font color="blue">return</font id="blue">;
<font color="blue">for</font id="blue"> (<font color="blue">int</font id="blue"> i = 0;i < <font color="blue">this</font id="blue">.FCADImage.Converter.GetCounts(CADImport.ConvSection.Entities); i++)
{
CADEntity entEntity = (CADEntity)<font color="blue">this</font id="blue">.FCADImage.Converter.GetSection(CADImport.ConvSection.Entities).Entities[i];
<font color="blue">if</font id="blue"> ((entEntity <font color="blue">is</font id="blue"> CADLine) || (entEntity <font color="blue">is</font id="blue"> CADCircle) || (entEntity <font color="blue">is</font id="blue"> CADText))
{
entEntity.Color = Color.Aqua;
<font color="blue">this</font id="blue">.cadPictBox.Invalidate();
}
}
}
Sergey.
Please post questions to the forum or write to
support@cadsofttools.com
Posted: 30 Mar 2007, 12:32
by nico28
Hi and thank's for your response.
So, in my CADImport.dll (6.0.2603.19339), there is no CADEntity, no FCADImage.Converter. They are in the CADImport.NET Help but not in the DLL.
In you sample "Viewer",
#if Professional
private CADEntity selEnt;
...
What that "Professional" ? another version of the DLL ?
Posted: 30 Mar 2007, 13:06
by support
Directive <font color="blue">#if Professional</font id="blue"> has no concern to the access to entities' data.
For changing entities' properties extended version of CAD Import .NET is required.
Please write contact us on
info@cadsofttools.com on this question.
Sergey.
Please post questions to the forum or write to
support@cadsofttools.com