CoCreate User Forum  

Go Back   CoCreate User Forum > Support > Customization
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 10-08-2004, 11:20 AM
Thom Ivancso's Avatar
Thom Ivancso Thom Ivancso is offline
Registered User
 
Join Date: Oct 2002
Location: Connecticut, USA
Posts: 212
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))
Now if I select the material Aluminum from the list it has a density of .098 and change the part to this it completes without errors, however when I open the Parts And Assembly Menu | Settings | Base Density to check the changed part I get the following feedback the density shows as 3.540474616 instead of .098.

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")
		    )
)
Has anyone tried to do something similar and ran into this problem?

Cheers
Thom
Reply With Quote
  #2  
Old 10-08-2004, 02:48 PM
Andy Poulsen Andy Poulsen is offline
Administrator
 
Join Date: Apr 2003
Location: Fort Collins, Colorado
Posts: 273
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)))
the function (sd-user-to-sys-units ...) is very useful for converting whatever units the user is using into sys units (as is the corresponding function (sd-sys-to-user-units ...).

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!
Reply With Quote
  #3  
Old 10-11-2004, 11:49 AM
Thom Ivancso's Avatar
Thom Ivancso Thom Ivancso is offline
Registered User
 
Join Date: Oct 2002
Location: Connecticut, USA
Posts: 212
Hello Andy,

Thanks I spaced that one completely..


Cheers
Thom
Reply With Quote
  #4  
Old 04-26-2005, 08:02 AM
Michel Gendron Michel Gendron is offline
Registered User
 
Join Date: Oct 2002
Location: LeMoyne, Québec, Canada
Posts: 56
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
Reply With Quote
  #5  
Old 04-26-2005, 08:16 AM
Thom Ivancso's Avatar
Thom Ivancso Thom Ivancso is offline
Registered User
 
Join Date: Oct 2002
Location: Connecticut, USA
Posts: 212
Post 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
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 02:37 PM.



Hosted by SureServer    Forums   Modeling FAQ   Macro Site   Vendor/Contractors   Software Resellers   CoCreate   Gallery   Home   Board Members   Regional User Groups  By-Laws  

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
You Rated this Thread: