YCAD Library Usage

2019-06-02 11:35发布

问题:

I started using the YCAD Library. The problem is that I cannot find any usage instructions and I am kind of confused because I have no idea how to use it. I am hoping that somebody here used it before or is using it now so he/she can give me some tips how to use the library.

Thank you in advance.

PS.

One of the requirements for the project is to develop it in Java. I know that there are some good libraries in C#, C++, etc. but I need to do it in Java.

Best regards, Dimitar Georgiev

回答1:

Import the classes such as com.ysystems.ycad.lib.yxxf.Yxxf.

Open the file object:

File flname = new File(filename);

Open the buffered input stream with the file:

BufferedInputStream is = null;

Open the buffered stream:

is = new BufferedInputStream(new FileInputStream(flname ));

Create the Yxxf object:

Yxxf dxfDrawing = new Yxxf();

Create the YdxfGetBuffer:

YdxfGetBuffer buffStream = new YdxfGetBuffer();

Set the type:

int typ = YdxfGetBuffer.GET_TYPE_MAIN; 
buffStream .setInput(typ, in, drawing);
YdxfGet.get(buffStream );

After this, you may probably find the objects and iterate through.