This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

DEVELOPERS FORUM - How to add Viewable to existing CAD file using IOM APIs

Rahul. - Friday, May 1, 2015 8:02 AM:

Hi Friends

I want to add  viewable files to existing CAD files in aras using IOM APIs. 

If anyone have code for that then please share it or guide me to how to do that.

Thanks

Rahul

 



DavidSpackman - Monday, May 4, 2015 7:25 AM:

Example for a new file (C#)

 

            // Edit the CAD item
            Item docItem = this.newItem("CAD","edit");
            docItem.setID("561D1A6CF3E143D2B56618B68789C284");

            // Create the File item and set the path to the file.
            Item fileItem = this.newItem("File", "add");
            fileItem.setProperty("filename", "Test File.pdf");
            fileItem.attachPhysicalFile("C:\Aras\WorkingDir\Test File.pdf");

            // Link the file to the File property
            docItem.setPropertyItem("viewable_file", fileItem);
 
            Item results = docItem.apply();
            if (results.isError()) 
            {
                // Error handling
                return inn.newError("Error: " + results.getErrorDetail());
            } else {
                // Success
            }

            return this;


Rahul. - Monday, May 4, 2015 1:15 PM:

Thanks David for quick reply &  Help :-)

 

Rahul Dixit