#1
|
||||
|
||||
Material density setting issue.
I have a lisp routine that is to allow the user the ability to change the material density of a selected part, by picking the material type off of a table. The command I am using to set the part density in my routine is such
Code:
(sd-call-cmds (set_part_base_density :parts parts :dens density)) I have tried several different conversions to get the right information to display but nothing seems to be working. I have even tried changing the instance of the part instead of the base but still I get the same answer as above. Here is my table information Code:
(sd-create-logical-table "Material-Density-List" :columns '(:Material :Density :Density_g) :columnNames '("Material Type" "Density lb/in3" "Density g/cm3") :types '(:string :mass :string) :units '( nil :lb nil) :contents '(("Acrylic" 0.043 "1.190") ("Alumina" 0.140 "3.875") ("Aluminum" 0.098 "2.713") ("BK-7 GLASS" 0.091 "2.510") ("Brass" 0.308 "8.525") ("Delrin" 0.055 "1.522") ("Ertalyte" 0.050 "1.384") ("Invar" 0.292 "8.083") ("Molybdenum" 0.373 "10.324") ("Semitrol" 0.048 "1.328") ("Silicon" 0.084 "2.325") ("Stainless" 0.287 "7.944") ("Steel" 0.283 "7.833") ("Teflon" 0.080 "2.214") ("UHMW" 0.034 "0.941") ) ) Cheers Thom |
#2
|
|||
|
|||
Hi Thom,
I believe the problem is that OSDM expects all units to be in internal units, so when you set the density in question, you are setting it to .098 g/mm^3 instead of .098 lb/in^3. Then when you inquire the density, OSDM automatically converts it to user units (i.e. lb/in^3), which is 3.540... I think your problem can be easily solved by simply adding a function call: Code:
(sd-call-cmds (set_part_base_density :parts parts :dens (sd-user-to-sys-units :density density))) I hope this helps! Good luck! andy
__________________
Andy Poulsen AI MAXTools: Dream. Design. Done. It's that easy! Add-ins bringing new functionality and speed to Creo Elements/Direct and CoCreate products. Now available for v17-v20+! See them in action at www.ai-maxtools.com and then try them for yourself -- FREE! |
#3
|
||||
|
||||
Hello Andy,
Thanks I spaced that one completely.. Cheers Thom |
#4
|
|||
|
|||
Re: Material density setting issue.
Stupid question... In v13.01 where is the "command help" I cannot find it! I want to know all the parameter fo sd-sys-to-user-units and I can't find it!
Thanks
__________________
Michel Gendron, ing |
#5
|
||||
|
||||
Re: Material density setting issue.
Hello Michel,
Try this path for the help files in the Intergration kit. C:\Program Files\CoCreate\OSD_Modeling_2005\help\osdm\Common\documentation\integration_kit\index.html hth Cheers Thom |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|