PDA

View Full Version : wrong behaviour of get_vol_prop


jkramer
05-12-2005, 04:02 AM
Hi,

I made a Lisp routine that lists volume and density of all 3d-parts in an assy.
This was easy and straightforward.
HOWEVER, for one reason or another the listed volumes are all the same. The volume value is the right one for the first 3d-part in the list, and all the others are given this same value ??!!
I've been doing all kinds of experiments (sd-call-cmds etc.), but I keep getting the same error. This goes for both OSD 11 and OSD 13.
Another weird problem: both in OSD 11 and OSD 13 we use mm/deg/g units, but the volume results are completely different results (OSD 13 displays the right ones). sd-sys-to-user-units doesn't change it, and OSD 13 doesn't recognise this command??!!
I attached the lisp code.
Anyone have a clue what's wrong???
Thanks!
Regards,
Jaap

dorothea
05-12-2005, 04:55 AM
Hi Jaap,

There is missing the keyword :part in the call to calculate the volume. Correct would be:
(get_vol_prop :for_part :part obj :volume)

If this keyword is missing it's the same like if it wasn't there. The dialog takes the current part. Therefore you see a result but in all calculations the same.

Dorothea

jkramer
05-12-2005, 04:58 AM
Thanks a lot!!!
Ehh.... do you have any idea why I get different volume values in OSD 13 than in OSD11???

Regards,
Jaap

dorothea
05-12-2005, 05:12 AM
Ehh.... do you have any idea why I get different volume values in OSD 13 than in OSD11???

No, no idea. I just tried it with some cubes but in version 11.65. The result was the same with version 13.00. Does it depend on the models or is there any difference when the structure is changed?

By the way, you should get warnings in the console window when loading the lisp file:
Warning: :NIL is not a feasible keyword for :modifies.
You should change the keyword :NIL and replace it by NIL.

Dorothea

jkramer
05-12-2005, 05:13 AM
Ahhhhhhhhhhhhhhhh........!!
Sorry, that last post was a stupid question.
I realize my mistake.
Sorry, all is solved!

Thanks again,
Jaap

jkramer
05-12-2005, 05:16 AM
Haha, just to late.
Because the volume of the current part was returned, and OSD 13 had another part current than OSD 11, there were different results.
So, to me it makes sense now.

Jaap