Page 1 of 1

Getting TsgDXFImage*

Posted: 09 Jun 2007, 15:09
by aby
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);

Posted: 09 Jun 2007, 15:21
by aby
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

Posted: 14 Jun 2007, 09:32
by aby
Is it so difficult to reply this question? How long should I have to wait? Please answer YES or NO?

Aby

Posted: 14 Jun 2007, 10:35
by support
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