B4J Question CAD files (step) view

Tayfur

Well-Known Member
Licensed User
Longtime User
Hello all;

can I view cad (step) files with B4J. I know, It's a little crazy idea.
After searching a bit I just found this. ( jsdai companent. )
This can I work/convert with B4J? (I ask because I do not Eclipse a and Java)


Code link:
https://stackoverflow.com/questions/39310352/jsdai-error-dictionary-data-file-is-missing-for-schema
B4X:
public class StepExtraction {
public static void main(String args[]) throws SdaiException {
    java.util.Properties prop = new java.util.Properties();
    prop.setProperty("repositories", "/Users/name/Repos");
    SdaiSession.setSessionProperties(prop);
    SdaiSession session = SdaiSession.openSession();
    SdaiTransaction transaction = session.startTransactionReadWriteAccess();
    SdaiRepository repository = session.importClearTextEncoding("MyRepo", "/Users/name/Downloads/cylinder.stp", null);
    if(!repository.isActive()) {
        repository.openRepository();
    }
    transaction.commit();

    ASdaiModel models = repository.getModels();
    SdaiIterator modelIterator = models.createIterator();
    while(modelIterator.next()) {
        SdaiModel model = models.getCurrentMember(modelIterator);
    }
}
}

http://www.jsdai.net/download
 

Tayfur

Well-Known Member
Licensed User
Longtime User
Why don't you take a look at the documentation of the file format and write a parser. I do think there are VB examples which you can adapt.
creating a new viewer is a long and tedious task. Therefore, I wanted to add a ready-made viewer.
it is easier to remove the viewer from the project. :)
 
Upvote 0
Top