What's new

Opening a sheet metal part in Alibre Script

denissps

New Member
To access regular Alibre parts from AlibreScript I use the following code:
part=Part("PathToYourPart","YourPartName.AD_PRT")
It works perfectly fine.


But sometimes I need to access the Alibre sheet metal parts, so I tried to use the following code:
part=Part("PathToYourPart","YourPartName.AD_SMP")
But it does not work and throws me the following exception:
Exception: The file 'PathToYourPart\YourPartName.AD_PRT' cannot be found.

Please note that it changes the part extension somewhere internally, and, of course, it cannot locate the following part because of it. It is just my guess, though.


Question: Is there a workaround? How can I access Alibre sheet metal parts through AlibreScript?

Thank you! =)

My Alibre version is Alibre Design Expert V28, build 28098. If it matters.
 

stepalibre

Alibre Super User
Question: Is there a workaround? How can I access Alibre sheet metal parts through AlibreScript?
You'll need to export it to some other format to load it in a AD_PRT or another API. Might not be what you want but I had a need to generate images, check weight and other minor things of sheet metal files and I did this to get it done.
 

denissps

New Member
Simple answer, Script is not supported for SMP or for 2D drawing workspaces.
Thank you for your answer.


Hmm, but I can access the sheet metal parts directly from the assembly like this:
parts = CurrentAssembly().Parts
for part in parts:
DoYourStuff


I use Alibre script to generate part descriptions (pull material, parameters, and data, and arrange them in order).
For example, if I have some plates in my assembly, the script will name them "Plate, AxBmm, Material, Comment". This works really well for me, and I have different naming rules for different components. Now I have more or less complex designs with subassemblies, and a lot of parts are arrayed/mirrored, so my scripts have to go through all these parts several times, and it takes a lot of time...
My idea was to aggregate all the parts' paths into an array, delete duplicates, and then assign names to them. But now it seems that I cannot access sheet metal parts with this method... =(
 
Top