Convert IFC EXPRESS schema entities/classes to VB.

2019-08-12 06:10发布

问题:

I'm working on an ifc project where I want to convert an EXPRESS file's classes into vb.net classes. It is really hard to process all the attributes of the stp file one by one, so I was wondering if there are alternative ways or tools which could convert the classes.

EDIT : I have discovered javatoolbox which does exactly what I want, but in java. I have also seen IFC Engine DLL but have not found any code available.

回答1:

Creating classes for full EXPRESS schema is relatively complex task. If your language/platform of choice is vb.net I'd recommend to have a look on xBIM. It is open source toolkit which provides all you need to open IFC model and extract/create any data you need. xBIM is mostly written in C# so you can just reference it as a NuGet package. The latest development code also supports IFC4.



回答2:

Both Jotne EPM www.epmtech.jotne.com and IFC Engine DLL www.ifcengine.com claim they support Visual Basic.



回答3:

You can try out oipExpress. oipExpress is a early binding generator written in C++. Just implement our own generator that generates VB.Net classes. Currently, it just generates C++ classes.

A basic generator for VB.Net classes could look like this (the generated binding can be found also here):

class GeneratorVBNet : public Generator {
public:
    GeneratorVBNet() {
    }
    virtual ~GeneratorVBNet() {
    }

    void generate(std::ostream &out, OpenInfraPlatform::ExpressBinding::Schema &schema) {
        for (int i = 0; i < schema.getEntityCount(); i++) {
            auto &entity = schema.getEntityByIndex(i);

            std::stringstream ss;
            ss << earlyBindingDestination << "\\" << entity.getName() << ".vb";

            std::ofstream ofs(ss.str(), std::ofstream::out);

            ofs << "Class " << entity.getName() << std::endl;

            ofs << "End Class" << std::endl;
        }
    }

private:
    std::string earlyBindingDestination = "E:\\dev\\EarlyBindingVBNet_IFC4x1_Add1";
};

The generated early binding will look like this:

The internal meta model of oipExpress looks like this:



标签: vb.net step ifc