Getting TsgDXFImage*

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

Moderators: SDS, support, admin

Post Reply
aby
Posts: 81
Joined: 21 May 2007, 13:02
Location: Turkey

Getting TsgDXFImage*

Post by aby » 09 Jun 2007, 15:09

Hi,

Now I'm able to run to use TSGDrawingNavigator in BCB6. Thanks.

How we can extract TsgDXFImage from TSGDrawingNavigator Object. As you know we extracting TsgDXFImage like the following

TsgDXFImage *FImg = dynamic_cast<TsgDXFImage *> (FDrwng->Picture->Graphic);

aby
Posts: 81
Joined: 21 May 2007, 13:02
Location: Turkey

Post by aby » 09 Jun 2007, 15:21

Hi,

Sorry I've send the previous mail by pushing the send button wrongly.
Here is the new post.

As you know we were extracting TsgDXFImage from TsgImage object like the following

TsgImage *sImage;
TsgDXFImage *FImg = dynamic_cast<TsgDXFImage > (sImage);

I've tried to extract the TsgDXFImage like the following but I couldn't.

TSGDrawingNavigator *FDrwng;
TsgDXFImage *FImg = dynamic_cast<TsgDXFImage *> (FDrwng->Picture->Graphic);

How can I extract the TsgDXFImage* object from TDrawingNavigator.

Thanks

Aby

aby
Posts: 81
Joined: 21 May 2007, 13:02
Location: Turkey

Post by aby » 14 Jun 2007, 09:32

Is it so difficult to reply this question? How long should I have to wait? Please answer YES or NO?

Aby

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

Post by support » 14 Jun 2007, 10:35

Hello Aby,

Please accept our apologies for the delay. We had a long lasting holidays in honor of our Motherland - <b>The Day of Russia</b>.

The following code is based on the mentioned in previous post <b>Template_BCB</b> demo available at: http://www.cadsofttools.com/download/Template_BCB.zip
Just put a button and a ListBox on the form and add the code:

Code: Select all

<b>void __fastcall</b> TForm1::btnViewEntitiesClick(TObject *Sender)
{
  TsgDXFEntity *Ent = NULL;

  <b>if</b> (!sgPaintBox->Empty())
    <b>if</b> (sgPaintBox->Picture->Graphic->InheritsFrom(<b>__classid</b>(TsgDXFImage)))
    {
      TsgDXFImage *FImg = <b>dynamic_cast</b><TsgDXFImage *> (sgPaintBox->Picture->Graphic);
      <b>for</b>(<b>int</b> i=0;i<FImg->Converter->Counts[csEntities]; i++)
      {
        Ent = FImg->Converter->Sections[csEntities]->Entities[i];
        ListBox1->AddItem(Ent->EntName(),Ent);
      }
    }
}
Sergey.


Please post questions to the forum or write to support@cadsofttools.com

Post Reply