IGES File

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

Moderators: support, SDS, admin

Post Reply
FieldConsult
Posts: 54
Joined: 14 Mar 2015, 22:33

IGES File

Post by FieldConsult » 23 Feb 2018, 00:07

Hello,

After load a IGES .igs file with the help of Open Cascade dll, is possible get the tree structure of the filen in xml format or in memory for visualization with a tree component?

Thanks!!!

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

Re: IGES File

Post by support » 26 Feb 2018, 18:39

Hello,

To get a tree structure of any drawing file (IGES, DWG, DXF, etc.) for visualization with a tree component (e.g. TTreeView), you will have to iterate through entities in the given file and add each entity to the structure using the following recursive procedure:

Code: Select all

uses
  ..., ComCtrls;

type
  tvStructure: TTreeView;

...

implementation

{$R *.dfm}

...

procedure Add(Parent: TTreeNode; E: TsgDXFEntity);
var
  I: Integer;
begin
  if Assigned(E) then
  begin
    Parent := tvStructure.Items.AddChildObject(Parent, E.EntName, E);
    Application.ProcessMessages;
    for I := 0 to E.Count - 1 do Add(Parent, E[I]);
  end;
end;
Could you please specify what objects you need to get from an IGES file for visualization with a tree component?


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

FieldConsult
Posts: 54
Joined: 14 Mar 2015, 22:33

Re: IGES File

Post by FieldConsult » 26 Feb 2018, 18:54

Hi Mikhail,
The full story is as follows:

I'm working with IFC files, from Revit, IFC format programming is a bit long to do, for now, and the programming of IFCXml or IFC to Xml is not as exhaustive, it requires a lot of code.

One solution that I am testing is to convert the IFC files (linear format) to IGES format and in that way obtain the structure of objects.

I must find the best solution to work with IFC files and show their structure in a tree and visualize their objects in the navigator, for constructive analysis.

Thanks for the information!!!

Felipe.

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

Re: IGES File

Post by support » 26 Feb 2018, 21:35

Felipe,

If you want to retain specific IFC objects when converting an .ifc file to IGES, I'm afraid that it is not possible, because the IGES standard defines a different kind of objects: edges, faces, loops, etc. So, depending on what objects you need to get, IFC -> IGES conversion may be appropriate or not appropriate solution.


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

Post Reply