PDA

View Full Version : Sheet Metal material selection


sstaabs
11-15-2005, 01:21 PM
Hello,

I am trying to add to some customization in Sheet Metal.

I cannot figure out how to set the default material programmatically.

Can anyone offer some assistance?

Here is the sample code attached. The attribute that I am trying to use is call MATL.

From the help page:

SHA_SET_DEFAULT_MATERIAL terminate action



SHA_SET_DEFAULT_MATERIAL sets the default sheet metal material type. Syntax

+--[material id]------->------+ | |-->(SHA_SET_DEFAULT_MATERIAL)--+--|confirmed material name|--+-->What is the program needing to select the material?

Thanks,

Steve

Wolfgang
11-18-2005, 11:48 AM
as it does help many times.. use the recorder to figure out what's needed.

If you do not know about "recorder" please read in the documentation - goodies.


start recording
enter in command line the command SHA_SET_DEFAULT_MATERIAL
a table pops up, which shows ALL the material available
select one material by douple click in table
stop recording

in the file recordered you'll find something like this:
SHA_SET_DEFAULT_MATERIAL
:MATERIAL_PLIST '(:MATERIAL "UST 1203" :THICK 2.0)

that's all and that is enough. You can reduce it to straight lisp syntax (e.g to reuse it in your own written utilities) to:
(SHA_SET_DEFAULT_MATERIAL :MATERIAL_PLIST '(:MATERIAL "UST 1203" :THICK 2.0))
resp.
(sd-call-cmds (SHA_SET_DEFAULT_MATERIAL :MATERIAL_PLIST '(:MATERIAL "UST 1203" :THICK 2.0)))
HTH

sstaabs
11-21-2005, 02:02 PM
Hello Wolfgang,

I do not know what syntax Sheet Metal is looking for to input into the command.

Attached are revised files for your review. There are screen captures of the errors and the revised lisp file.

(sd-call-cmds (SHA_SET_DEFAULT_MATERIAL :MATERIAL_PLIST '(:MATERIAL "UST 1203" :THICK 2.0)))
How do you create the list that it is looking for?

Do I use :MATERIAL_PLIST in the Sheet Metal macro?

Thank you in advance,

Steve

Wolfgang
11-22-2005, 11:16 AM
Hi 'staabs'

don't know what your local time zone is. So just a quick quickly in the late evening of german time.

This one is not good

(sd-call-cmds (SHA_SET_DEFAULT_MATERIAL
:MATERIAL_PLIST '(:MATERIAL Matl_desc :THICK Matl_thk)))


everything written between an open and machtin closing bracket after a qoute will be used as it is. It will not be evaluated as it is called. That's lisp. (I will not go to explain it here.

so very first change is:

(sd-call-cmds (SHA_SET_DEFAULT_MATERIAL
:MATERIAL_PLIST (list :MATERIAL Matl_desc :THICK Matl_thk)))


Give it a try please.
-----------------
I'm missing in your code the creation of a part. I see a workplane and a rectangle... but then... no part is created.. Am I wrong?

sstaabs
11-22-2005, 05:42 PM
Thank you Wolfgang,

The code for creating the part was removed to avoid confusion.

I will try what you suggest tomorrow. I am in the Eastern time zone in the USA.

I will post updated code after I test it tomorrow.

sstaabs
11-23-2005, 05:30 AM
Here are the completed files.

Thank you for all of your help.

Steve