Giter Site home page Giter Site logo

ifc.java's People

Contributors

dependabot[bot] avatar pipauwel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

ifc.java's Issues

MismatchedInputException

Hi,

while loading your sample the following error occures:

private void sample() {
         InputStream is = null;
         try {
             String filePath = "sample.ifcxml";
             File xml = new File(filePath);
             is = new FileInputStream(xml);
             XmlMapper m = new XmlMapper();
             m.configure(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY, true);
             m.configure(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT, true);
             m.configure(DeserializationFeature.ACCEPT_EMPTY_ARRAY_AS_NULL_OBJECT, true);
             IfcProject proj = m.readValue(is, IfcProject.class);
             IfcLabel s = proj.getName();
             System.out.println(s.getValue());
         } catch (Exception ex) {
             System.out.println(ex.getMessage());
             Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
         } finally {
             //ignore null for now
                     is.close();
         }
     }
Cannot construct instance of `com.buildingsmart.tech.ifc.IfcKernel.IfcProject` (although at least one Creator exists): cannot deserialize from Object value (no delegate- or property-based Creator)
 at [Source: (FileInputStream); line: 2, column: 1]
Nov 13, 2020 8:35:22 AM de.comp.Main start
SCHWERWIEGEND: null
com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot construct instance of `com.buildingsmart.tech.ifc.IfcKernel.IfcProject` (although at least one Creator exists): cannot deserialize from Object value (no delegate- or property-based Creator)
 at [Source: (FileInputStream); line: 2, column: 1]
	at com.fasterxml.jackson.databind.exc.MismatchedInputException.from(MismatchedInputException.java:63)
	at com.fasterxml.jackson.databind.DeserializationContext.reportInputMismatch(DeserializationContext.java:1329)
	at com.fasterxml.jackson.databind.DeserializationContext.handleMissingInstantiator(DeserializationContext.java:1031)
	at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromObjectUsingNonDefault(BeanDeserializerBase.java:1275)
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:325)
	at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeWithObjectId(BeanDeserializerBase.java:1235)
	at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeOther(BeanDeserializer.java:192)
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:161)
	at com.fasterxml.jackson.dataformat.xml.deser.WrapperHandlingDeserializer.deserialize(WrapperHandlingDeserializer.java:120)
	at com.fasterxml.jackson.databind.jsontype.impl.AsPropertyTypeDeserializer._deserializeTypedForId(AsPropertyTypeDeserializer.java:130)
	at com.fasterxml.jackson.databind.jsontype.impl.AsPropertyTypeDeserializer.deserializeTypedFromObject(AsPropertyTypeDeserializer.java:97)
	at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeWithType(BeanDeserializerBase.java:1156)
	at com.fasterxml.jackson.dataformat.xml.deser.WrapperHandlingDeserializer.deserializeWithType(WrapperHandlingDeserializer.java:137)
	at com.fasterxml.jackson.databind.deser.impl.TypeWrappedDeserializer.deserialize(TypeWrappedDeserializer.java:68)
	at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4001)
	at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3058)
	at de.comp.Main.start(Main.java:35)
	at de.comp.Main.main(Main.java:21)

Any ideas what I might be doing wrong?

The following error occurred during file conversion

The following error occurred during file conversion:

Exception in thread "main" java.lang.IllegalArgumentException: Can not set com.buildingsmart.tech.ifc.IfcMeasureResource.IfcValue field com.buildingsmart.tech.ifc.IfcPropertyResource.IfcPropertySingleValue.nominalValue to com.buildingsmart.tech.ifc.IfcMeasureResource.IfcLogical
at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:167)
at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:171)
at sun.reflect.UnsafeObjectFieldAccessorImpl.set(UnsafeObjectFieldAccessorImpl.java:81)
at java.lang.reflect.Field.set(Field.java:764)
at com.buildingsmart.tech.IO.IfcParser.loadToClassLibrary(IfcParser.java:324)
at com.buildingsmart.tech.IO.IfcParser.parseModelFromSPF(IfcParser.java:200)
at com.buildingsmart.tech.IO.IfcParser.main(IfcParser.java:102)

Model ID not exported? No way to link the exported data to the original model?

Hi,
In the ifc file there is an id for every object but in the xml or json generated I don't see this id, instead I see a new generated guid. We need to link some extra data to the actual model but without the original identifier I don't know how I can link the parsed data to the original object in the ifc model.

I am talking about the first number at the start of the line.

...
#1= IFCORGANIZATION($,'Autodesk Revit 2019 (ENU)',$,$,$);
#5= IFCAPPLICATION(#1,'2019','Autodesk Revit 2019 (ENU)','Revit');
#6= IFCCARTESIANPOINT((0.,0.,0.));
#9= IFCCARTESIANPOINT((0.,0.));
#11= IFCDIRECTION((1.,0.,0.));
#13= IFCDIRECTION((-1.,0.,0.));
...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.