Page 1 of 1
IGES File
Posted: 23 Feb 2018, 00:07
by FieldConsult
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!!!
Re: IGES File
Posted: 26 Feb 2018, 18:39
by support
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
Re: IGES File
Posted: 26 Feb 2018, 18:54
by FieldConsult
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.
Re: IGES File
Posted: 26 Feb 2018, 21:35
by support
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