importing dwg/dxf files generated by revit
Moderators: SDS, support, admin
importing dwg/dxf files generated by revit
Hi!
I am using a Delphi CADVCL importer similar to the one in use in the _3D Demo for creating a surface model from a dxf file made in revit.
I can see the dxf contains the word REVIT and also a list with all the revit names of BIM elements contained in the model (i.e. category + subcategory under revit's Families menu). I wonder weather this information is stored or not inside the code? and if so where to find it? it would be really great being able to detect programmatically that the input dxf is made with revit and if that is the case group the surfaces contained inside a single BIM element.
For reading the file I am using an object as follows:
Then I iterate through the stack of entities in the model using:
at every iteration Inside my ReadCADEntities function the current entity is of type TsgDXFEntity.
is it possible to get the information I am looking for from any of this objects?
regards, Carlos.
I am using a Delphi CADVCL importer similar to the one in use in the _3D Demo for creating a surface model from a dxf file made in revit.
I can see the dxf contains the word REVIT and also a list with all the revit names of BIM elements contained in the model (i.e. category + subcategory under revit's Families menu). I wonder weather this information is stored or not inside the code? and if so where to find it? it would be really great being able to detect programmatically that the input dxf is made with revit and if that is the case group the surfaces contained inside a single BIM element.
For reading the file I am using an object
Code: Select all
Img : TsgCADImage
Code: Select all
Img.LoadFromFile(DxfFileName);
Code: Select all
Img.Converter.Iterate(ReadCADEntities, FinishEntity, FCADParams);
is it possible to get the information I am looking for from any of this objects?
regards, Carlos.
Re: importing dwg/dxf files generated by revit
Hi Carlos,
Could you please send us an example file by email?
Kind regards,
Maria
Could you please send us an example file by email?
Kind regards,
Maria
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support
Re: importing dwg/dxf files generated by revit
You can find this data in the Objects section:
Regards,
Maria.
Code: Select all
[function GetRevitTypeMapping(ARevitDictionary: TsgDXFDictionary): TsgDXFXRecord;
begin
if Assigned(ARevitDictionary) then
Result := TsgDXFXRecord(ARevitDictionary.FindEntByName('REVIT_TYPE_MAPPING'))
else
Result := nil;
;
end;
function GetRevitDictionary(AImg: TsgCADImage): TsgDXFDictionary;
begin
if Assigned(AImg.Converter.Sections[csObjects][0]) then
Result := TsgDXFDictionary(AImg.Converter.Sections[csObjects][0].FindEntByName('REVIT_DICTIONARY'))
else
Result := nil;
end;
procedure TForm1.enumrevitmappingdata;
var
vData: TsgDXFXRecord;
I: Integer;
begin
vData := GetRevitTypeMapping(GetRevitDictionary(FImg));
if Assigned(vData) then
for I := 0 to vData.Data.DataCount - 1 do
if vData.Data.DataType[I] = edtString then
...
end;
Maria.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support