How to get a single entity from 3D object (STEP)

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

Moderators: SDS, support, admin

Post Reply
Mariusz_Unilink
Posts: 8
Joined: 28 Jan 2022, 15:35

How to get a single entity from 3D object (STEP)

Post by Mariusz_Unilink » 28 Jan 2022, 15:48

Hello everyone!

I have a question:
How to get a single entity like line, arc, b-spline, or cylindrical surface, conical surface etc. from the 3D object (STEP).
I have 3D (STEP) file on the screen and it is displayed properly.

Code in C++ (Builder 2009).

Code: Select all

void __fastcall TformMain::mOpenSTEPClick(TObject *Sender)
{
  OpenDialog1->Filter =  "STEP Files(*.stp, *.step)|*.stp;*.step";

  if(OpenDialog1->Execute())
  {
    CloseNavigators();
    //Loading TsgDrawingNavigator *FsgPaintBox;
    FsgPaintBox->Picture->LoadFromFile(OpenDialog1->FileName);
    FsgPaintBox->BeginUpdate();
    try
    {
      ((TsgCADImage *)(FsgPaintBox->Picture->Graphic))->CustomDraw = false;
      FsgPaintBox->FitToSize();
    }
    __finally
    {
      FsgPaintBox->EndUpdate();
    }
    //Loading Tsg3DDrawingNavigator *stepDrawingNavigator;
    if(LoadedCADImage)
    {
      if(stepDrawingNavigator->Empty() && (stepDrawingNavigator->LoadFromImage == NULL))
      {
        //first time loaded
        try
        {
          Screen->Cursor = crHourGlass;
          stepDrawingNavigator->LoadFromConverter(LoadedCADImage->Converter, LoadedCADImage);
        }
        __finally
        {
          Screen->Cursor = crDefault;
        }
      }
      else
      {
        //next time loaded
        if(stepDrawingNavigator->LoadFromImage != NULL)
        {
          LoadViewFromCADImage(LoadedCADImage,stepDrawingNavigator);
        }
      }
      Tsg3DShowingStyles style;
      style << ssSmoothShading << ssLighting;
      stepDrawingNavigator->ShowingStyle = style;
      stepDrawingNavigator->FitToSize();
      FsgPaintBox->Visible = false;
      stepDrawingNavigator->Visible = true; //only 3D visible

      //TESTS:
      int entitiesCount;
      String entityName;
      TsgDXFEntity *entity;
      entitiesCount = LoadedCADImage->Converter->Counts[csEntities];
      //entitiesCount in case of very big STEP file = 1 (why?)
      for(int i=0; i<entitiesCount; i++)
      {
        entity = LoadedCADImage->Entities[i]; //this is siome general entity (some single block) (why?)
        if(entity)
        {
          entityName = entity->Name; 
          entityName = entity->EntName();
        }
      }
    }
  }
}
//---------------------------------------------------------------------------


Thank you for any help!

Greetings,

Mariusz

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

Re: How to get a single entity from 3D object (STEP)

Post by support » 28 Jan 2022, 17:10

Hi Mariusz,

Unfortunately it is not possible at the moment. We are working on 3D improvement at the moment. Stay tuned to get the news about CAD VCL.

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

Mariusz_Unilink
Posts: 8
Joined: 28 Jan 2022, 15:35

Re: How to get a single entity from 3D object (STEP)

Post by Mariusz_Unilink » 31 Jan 2022, 17:14

Thank you Maria for the reply!

Im wondering - if there is a possibility to get some STEP entities not directly from the TsgDrawingNavigator or Tsg3DDrawingNavigator...
If you know some - please let me know.

Kind regards,

Mariusz

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

Re: How to get a single entity from 3D object (STEP)

Post by support » 01 Feb 2022, 11:31

Unfortunately, there is no such possibility for now. But 3D formats are one of our priorities at the moment, so I passed the info to our r&d team.

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

Post Reply