Convert IFC EXPRESS schema entities/classes to VB.NET classes

限于喜欢 提交于 2019-12-24 08:22:53

问题


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:



来源:https://stackoverflow.com/questions/37204634/convert-ifc-express-schema-entities-classes-to-vb-net-classes

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!