Urban_42 - Friday, June 22, 2012 4:35 AM:
Hi!
I am trying to write a simple method with which I will be able to checkout a native file attached to a CAD document. This is what I have so far:
var partName = prompt("Enter the Part Name:",""); // enter CAD, that you wish to checkout
var inn = this.getInnovator();
cad = inn.getItemByKeyedName("native_file",partName); // get item with the name
// error if not successful
if (cad.isError())
{
top.aras.AlertError(cad.getErrorDetail());
return;
}
// otherwise checkout native file
var file = cad.checkout("H:\ ")
I always get the error, that the native file is inaccessible.
I would be glad for some pointers on how to proceed.
Thank you, Urban Potocnik
vasant - Saturday, June 23, 2012 12:13 AM:
Hello Urban,
Please use following updated code for Checkout native_file form CAD.
var partName = prompt("Enter the Part Name:",""); // enter CAD, that you wish to checkout
var inn = this.getInnovator();
cad = inn.getItemByKeyedName("CAD",partName); // get item with the name
if (cad.isError())
{
top.aras.AlertError(cad.getErrorDetail());
return;
}
var File=inn.getItemById("File",cad.getItemByIndex(0).getProperty("native_file"));
if (File.isError())
{
top.aras.AlertError(File.getErrorDetail());
return;
}
var FileCheck=File.checkout("H:\ ");
return this;
Hope it helps...
Thanks & Regards,
Vasant Padhiyar
Urban_42 - Tuesday, June 26, 2012 2:51 AM:
Sorry, still doesn't work and I think that native_file is a PropertyItem rather than just Property.
Thanks anyway, will keep you posted if anything comes through.
Regards, Urban Potocnik