Change Entity Color?

Discuss and ask questions about CAD VCL (Delphi and C++ Builder).

Moderators: SDS, support, admin

Post Reply
k83tw
Posts: 1
Joined: 01 Apr 2008, 13:10

Change Entity Color?

Post by k83tw » 01 Apr 2008, 13:29

part1. 4/1
Hi,

I was see demo code Editor.

Entity-Inspector-button show Entity's value(include color and pos).

But it can't change color.

How to change color of entity?

And where are sample's(or demo) of change entity value's.

Is it possible to change the color(or some value) of entity?

part2. 4/2
I found some code change entity's color.(by hlp file)

I use that code like this.
=================================================
IN Editor Demo : fEntityInspector procedure( RefreshGrid)
Entity.SetColor($000000FF);

=================================================

This code can change entity value to red.

But I want to more information about change color.

There is no another way?(easy way...)

And Now i have more question.

How to get entity from cad file?

Is there way to find entity by name(or some entity-value)?

If you have more demo code or source for these problem, please send to my e-mail.

My english is crappy. Please understand by these question.

Thanks.

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

Re: Change Entity Color?

Post by support » 15 Apr 2008, 11:58

Hello!

First of all we must say that Editor demo is no more supported for CAD Import VCL.
The following code get all entities in the file and changes theirs color to Yellow:

Code: Select all

procedure TfmMain.Button1Click(Sender: TObject);
var
  I: Integer;
  vImg: TsgDXFImage;
  vEnt: TsgDXFEntity;
begin
  vImg := TsgDXFImage(DNavigator.Picture.Graphic);
  for I := 0 to vImg.CurrentLayout.Converter.Counts[csEntities] - 1 do
  begin
    vEnt := TsgDXFEntity(vImg.CurrentLayout.Converter.Sections[csEntities].Entities[I]);
    vEnt.SetColor(clYellow);
    vImg.CurrentLayout.Converter.Loads(vEnt);
  end;
  DNavigator.Invalidate;
end;
Is there way to find entity by name(or some entity-value)?
When you get an entity by the following line:

Code: Select all

vEnt := TsgDXFEntity(vImg.CurrentLayout.Converter.Sections[csEntities].Entities[I]);
it is necessary to analyse what time entity is it and to determine whether you need it.

Sergey.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

Post Reply