Which JAR contains the ICadDrawingDataset?

425
3
Jump to solution
02-13-2013 07:33 PM
Highlighted
New Contributor
Hi,
using Java SDK 10.1 I'm trying to load a DWG file. Code snippet from sample below.
My question: Which jar library do I have to load to resolve the types ICadDrawingDataset, CadLayer, ICadDrawingDatasetProxy?
Thank you!
Peter

    /**
     * Adds data to control by using the file path.
     */

    public void addData()
    {
      // Get the last index of file separator
      try
      {
        int index = filePath.lastIndexOf(File.separator);
        // Get the directory path containing file path
        String strWorkspacePath = filePath.substring(0, index);
        String fileName = filePath.substring(index + 1);
        System.out.println(fileName);
        ICadDrawingDataset cadDrawingDataset = getCadDataSet(strWorkspacePath, fileName);
        if (cadDrawingDataset == null)
        {
          return;
        }
        // Create a cad layer using cad dataset and add it to map control.
        CadLayer cadLayer = new CadLayer();
        cadLayer.setCadDrawingDatasetByRef(cadDrawingDataset);
        cadLayer.setName(fileName);
        mapBean.addLayer(cadLayer, 0);
      }
      catch (IOException ex)
      {
        System.out.println("Exception in addData : " + ex);
        ex.printStackTrace();
      }
    }

    /**
     * Function which creates cad data set using cad workspace path and filname.
     */
    public ICadDrawingDataset getCadDataSet(String cadWorkspacePath, String cadFileName)
    {
      try
      {
        // Create a WorkspaceName object
        WorkspaceName workspaceName = new WorkspaceName();
        workspaceName.setPathName(cadWorkspacePath);
        workspaceName.setWorkspaceFactoryProgID("esriDataSourcesFile.CadWorkspaceFactory");

        // Create a CadDrawingName object
        CadDrawingName cadDrawingName = new CadDrawingName();
        cadDrawingName.setName(cadFileName);
        cadDrawingName.setWorkspaceNameByRef(workspaceName);

        // Open the CAD drawing
        ICadDrawingDataset cadDrawingDataset = new ICadDrawingDatasetProxy(cadDrawingName.open());

        return cadDrawingDataset;
      }
      catch (IOException ex)
      {
        System.out.println("Exception in getDataSet : " + ex);
        ex.printStackTrace();
        return null;
      }

    }
Reply
0 Kudos
1 Solution

Accepted Solutions
Highlighted
Regular Contributor
Which jar library do I have to load to resolve the types ICadDrawingDataset, CadLayer, ICadDrawingDatasetProxy?


Which jar library?  That Interface is part of the arcobjects.jar

http://resources.arcgis.com/en/help/arcobjects-java/api/arcobjects/com/esri/arcgis/datasourcesfile/I...

View solution in original post

Reply
0 Kudos
3 Replies
Highlighted
Esri Regular Contributor
Hi Peter,

I'm looking at your code and thinking this looks like ArcObects to me.  ICadDrawingDatasetProxy isn't part of the ArcGIS Runtime for Java SE product.

The Java SE Runtime SDK for Java is a new product from ESRI which isn't based on ArcObjects as we've written it from the ground (no COM!)

I've moved your post so it appears in the ArcObjects forum so you get a better chance of getting a good answer.

Good luck

Mark
Reply
0 Kudos
Highlighted
Regular Contributor
Which jar library do I have to load to resolve the types ICadDrawingDataset, CadLayer, ICadDrawingDatasetProxy?


Which jar library?  That Interface is part of the arcobjects.jar

http://resources.arcgis.com/en/help/arcobjects-java/api/arcobjects/com/esri/arcgis/datasourcesfile/I...

View solution in original post

Reply
0 Kudos
Highlighted
New Contributor
Thank you, ldonahue!
Reply
0 Kudos