Comments

  • I find this stack incredibly Windows-centric. Part of the reason I prefer IfcOpenShell, apart from the Python bindings which are a huge time-saver for rapid prototyping, is that it is much easier to build platform agnostic with.

  • I should share my Perl module for reading and writing IFC files, it is very much limited to functionality that I specifically need, but somebody may find this useful:

    It also includes a vim syntax highlighting file for IFC files which makes them much easier to read

  • @brunopostle that's very cool! Can you update the readme showing some examples of how to use it? Then we should definitely add it to the Wiki AEC software directory! (or, since it's a wiki, you should add it yourself!) https://wiki.osarch.org/index.php?title=AEC_Free_Software_directory

  • @Moult I'll add a wiki entry for File::IFC. The documentation is in perl pod format, so I don't duplicate it in the README. Here's the documentaiton for the base class should anyone be interested:

    NAME

    File::IFC - Industry Foundation Classes

    SYNOPSIS

    A tool for writing IFC STEP files for Building Information Modelling (BIM)

    DESCRIPTION

    File::IFC contains basic methods for reading and writing IFC files. To write real-world IFC files you probably want to use the sub-class File::IFC::Helpers, which contains methods for assembling headers, components etc...

    METHODS

    new Create a File::IFC project like so:

         use File::IFC;

         $ifc = File::IFC->new;

    FILE_XXXX

    Add a header item to the project, these methods are created on the fly:

         $ifc->FILE_FOP ('Some text', ['a', 'sub', 'list']);

    IFCXXXXX

    Add entities to the project, these methods are created on the fly:

         $foo = $ifc->IFCFOO;

         $foo->Add ('Some text', undef, 12.0);

         $bar = $ifc->IFCBAR ('Some other text', undef, 12.03, '.ELEMENT.', 1.0E-05);

         $ifc->IFCBAZ (undef, 'More text', $foo, $bar);

         $ifc->IFCNOO ($foo, [0.0,1.0,0.0], undef, [$foo, $bar]);

    Note, to force a number to be interpreted as a string, prefix it with 'STRING:'

         $ifc->IFCNAR ('Year', 'STRING:2013');

    Note, this library does _no_ entity validation, you can create any method name you like, say $ifc->IFCWHATEVER(undef), and #123=IFCWHATEVER($); will be written to the file.

    Parse

    Alternatively, parse existing IFC data (this expects an array of lines):

         $ifc->Parse (@lines);

    Dump Text

    Generate a IFC formatted data as an array of lines:

         @list = $ifc->Dump;

    ..or join it all together as a single text blob:

         print $ifc->Text;

    This results in text output like so:

         ISO-10303-21;

         HEADER;

         FILE_FOP('Some text',('a','sub','list'));

         ENDSEC;

         DATA;

         #1=IFCFOO('Some text',$,12);

         #2=IFCBAR('Some other text',$,12.03,.ELEMENT.,1.E-05);

         #3=IFCBAZ($,'More text',#1,#2);

         #4=IFCNOO(#1,(0,1,0),$,(#1,#2));

         #5=IFCNAR('Year','2013');

         ENDSEC;

         END-ISO-10303-21;

    Cache_Ids

    Build a lookup table of entity ids (optional, this just speeds up the Get_Id() method):

         $ifc->Cache_Ids;

    Renumber Merge_Ifcrel

    Go through list of entities and renumber without changing order (the data is stored as a big list, this just deletes empty list entries):

         $ifc->Renumber;

    Merge entities that specify a relationship such as IFCRELASSOCIATESMATERIAL, IFCRELCONTAINEDINSPATIALSTRUCTURE and IFCRELAGGREGATES:

         $ifc->Merge_Ifcrel;

    i.e. multiple entries like this get removed:

         #25=IFCRELAGGREGATES('0wsQ2vBzIYI3uTHLpG2INA',#5,$,$,#19,(#24));

         #30=IFCRELAGGREGATES('0dUwp9Ptxt608YBTVMwlQQ',#5,$,$,#19,(#29));

    ..and replaced by a single entry like this (note that as entries are removed, subsequent entries are renumbered):

         #1439=IFCRELAGGREGATES('2OknSXOQLN6pcUngENnLLw',#5,$,$,#19,(#24,#28));

    Refcount

    Count number of references to each entity, increments _refcount for each entity found:

         $ifc->Refcount;

    Get_Id

         $id = $ifc->Get_Id ($entity);

    Returns an integer id prefixed with a hash, e.g: #1234

    FUNCTIONS

    guid

    Create a random (probably) unique UID:

         $string = guid();

  • Very cool! Thanks for adding it to the wiki!

  • You can add also the Stepcode project

    https://www.continuum.codes/stepcode/

    haven't seen in the list

  • @mko - great project! Would you like to add it? It is a wiki :)

  • will register soon :)

Sign In or Register to comment.