×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

MASS PROP

MASS PROP

MASS PROP

(OP)
WOULD ANYONE HAVE A LISP PROGRAM ON CONVERTING MASSPROP FROM A VOLUME UNIT TO A WEIGHT UNIT BY INTRODUCING A DENSITY FACTOR RELATING TO MATERIAL OF THE OBJECT DRAWN.

RE: MASS PROP

If someone answers this question, please forward it to me.  I am also looking for a very similar lisp routine to return region section properties and place the data into a table/block that I've created.  enclad@sbcglobal.net

RE: MASS PROP

Hey guys checkout Thread555-27590! This is right up your creek.Good Luck

RE: MASS PROP

if your looking for a lisp that allows you to select a solid or group of solids then report the weight and center of gravity, then this is your lisp for autocad 2000 and up

;This program draws a point at the centroid of a
;region or solid.  The point is drawn on the current
;layer at the current settings. It creates a file
;called deleteme.mpr in c:\temp directory that can
;be deleted if wanted, otherwise the program will
;just overwrite it everytime it runs.

(defun c:CG2002 (/ ss mprfile title c-steel s-steel alumn UHMW Neoprene Pine )

(setq    c-steel        0.2833
    s-steel        0.286
    alum        0.098
    UHMW        0.0347
    Neoprene        0.045
    Pine        0.022)
(setvar "filedia" 0)
(setvar "cmdecho" 0)
(print "Select solids or regions")
(setq ss (ssget))
(command "massprop" ss "" "y" "c:/temp/deleteme")
(setvar "filedia" 1)

(setq mprfile (open "c:/temp/deleteme.mpr" "r"))
(read-line mprfile)
(setq title (read-line mprfile))
(close mprfile)
(if (= nil (wcmatch title "*REGION*")) (CG-SOLID) (CG-REGION))
)
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

(defun CG-REGION (/ mprfile area-line x-line y-line x-coord
            area-size y-coord point-coord old-osnap
            weight-cs weight-ss weight-al weights)

(setq mprfile (open "c:/temp/deleteme.mpr" "r"))
(repeat 3 (read-line mprfile))
(setq area-line (read-line mprfile))
(repeat 3 (read-line mprfile))
(setq x-line (read-line mprfile))
(setq y-line (read-line mprfile))
(close mprfile)

(setq    area-size     (atof(substr area-line 25))
    weight-cs    (* area-size c-steel)
    weight-ss    (* area-size s-steel)
    weight-al    (* area-size alum)
    weight-UHMW    (* area-size UHMW)
    x-coord     (atof(substr x-line 25))
    y-coord     (atof(substr y-line 25))
    point-coord    (list x-coord y-coord)
    old-osnap    (getvar "osmode")
)

(setvar "osmode" 0)
(command "point" point-coord)
(setvar "osmode" old-osnap)
(setq weights (strcat     "Weights at 1 inch thick: " (rtos weight-cs 2 1) "# cs, "
        (rtos weight-ss 2 1) "# ss, " (rtos weight-al 2 1) "# al " (rtos weight-UHMW 2 1) "# UHMW "))
(alert weights)
(print weights)
(princ)
)
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

(defun CG-SOLID (/ mprfile vol-line x-line y-line z-line x-coord
           y-coord z-coord vol-size point-coord old-osnap
           weight-cs weight-ss weight-al weights)

(setq mprfile (open "c:/temp/deleteme.mpr" "r"))
(repeat 4 (read-line mprfile))
(setq vol-line (read-line mprfile))
(repeat 3 (read-line mprfile))
(setq x-line (read-line mprfile))
(setq y-line (read-line mprfile))
(setq z-line (read-line mprfile))
(close mprfile)

(setq    vol-size     (atof(substr vol-line 25))
    weight-cs    (* vol-size c-steel)
    weight-ss    (* vol-size s-steel)
    weight-al    (* vol-size alum)
    weight-UHMW    (* vol-size UHMW)
    x-coord     (atof(substr x-line 25))
    y-coord     (atof(substr y-line 25))
    z-coord     (atof(substr z-line 25))
    point-coord    (list x-coord y-coord z-coord)
    old-osnap    (getvar "osmode")
)

(setvar "osmode" 0)
(command "point" point-coord)
(setvar "osmode" old-osnap)
(setq weights (strcat     "Weights: " (rtos weight-cs 2 1) "# cs, " (rtos weight-ss 2 1)
        "# ss, " (rtos weight-al 2 1) "# al " (rtos weight-UHMW 2 1) "# UHMW "))
(alert weights)
(print weights)
(princ)
)

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources