Author Topic: volume masselement vs 3d solid  (Read 2071 times)

0 Members and 1 Guest are viewing this topic.

rooster jk

  • Guest
volume masselement vs 3d solid
« on: April 22, 2011, 02:18:15 PM »
i'm trying to figure out how to get a vlisp routine to allow me to place a field with the volume of a 3d solid or mass element in the field.  i keep running into an issue of the 3d solid's volume and the mass element volumes units are not controlled by the same thing - or so it appears.  the mass element volume units change with the usuer imput of the 'units'...so if the user changes the units of the volume to be cubic inches that is was the units of the mass element is, if 'units' are changed to cubic feet then that is what the mass element units are.  the 3d solid does not change units and acad returns only cubic inches.  so what i'm wondering is if anyone has any thoughts on how to be able to get the field to give the same units for both the 3d solid and the mass element regardless of what the user has set the units to.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: volume masselement vs 3d solid
« Reply #1 on: April 22, 2011, 04:52:50 PM »
Welcome to the Swamp. 8-)

Can you post some code that you have tried already?


PS, a sample DWG will help as well.
« Last Edit: April 22, 2011, 04:56:15 PM by CAB »
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: volume masselement vs 3d solid
« Reply #2 on: April 22, 2011, 05:23:49 PM »
Perhaps this will help:
Quote
Advanced formatting of AutoCAD 2005/2006 fields.
A Control codes in automatic text fields introduced in AutoCAD 2005 (the FIELD command) allow some detailed options which are not available in the standard user interface.
Fortunately, you can enter the field code manually (or by pasting) anywhere in the MText editor, when entering DText or in the DDEDIT dialog. Using this method, you can use some advanced formatting to your field values - see some examples:

%<\AcObjProp Object(%<\_ObjId 2130100448>%).Area \f "%.3f">% - displays object area to 3 decimal places (independently on LUPREC setting)
%<\AcObjProp Object(%<\_ObjId 2130042784>%).Area \f "%lu2%ct4%qf1%PR0 sq.ft.">% - displays object area in sq.ft. rounded (to 0 decimal places)

This worked for me, you will need to put your ObjectId number in place of 2119599984
%<\AcObjProp Object(%<\_ObjId 2119599984>%).Volume \f "%.3f">%
« Last Edit: April 22, 2011, 06:31:20 PM by CAB »
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: volume masselement vs 3d solid
« Reply #3 on: April 22, 2011, 06:36:22 PM »
OK, I think I did not understand you problem.
Perhaps someone with more solids experience will lend a hand.
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

rooster jk

  • Guest
Re: volume masselement vs 3d solid
« Reply #4 on: April 25, 2011, 12:14:54 PM »
OK, I think I did not understand you problem.
Perhaps someone with more solids experience will lend a hand.


well what you are doing is on the right track i think...but it appears that you are going for area where i'm looking for volume.  so basically what i'm trying to do really is have a lisp (i think lisp, maybe vb) allow me to do the following:

i have a block that has an attribute in it that is a field that i want to have linked to an object.  so i would like to be able to run a lisp that allows me to replace the object that the field is linked to and have the attribute update accordingly.  so i'm envising something like this from the lisp routine as far as how it would opperate: run lisp, it prompts for "pick what block you want to update (this would have to have an attribute), pick what object you want to link to the block (this would be the 3d solid or masselement), cad would then update the attribute with the appropriate data from the block that was selected.

make any sense???