Change color
Moderators: SDS, support, admin
Change color
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 ?
I need to change the color of all elements in my DXF.
Example : all lines, circles, texts, ... , in Red.
How can i do that ?
Hello Nico!
Please use the following code (it is based on Viewer demo, find it in the ..\cadimportnet\sources\Viewer\.. folder):
Sergey.
Please post questions to the forum or write to support@cadsofttools.com
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();
}
}
}
Please post questions to the forum or write to support@cadsofttools.com
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 ?
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 ?
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
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