Jump to content

Recommended Posts

Posted (edited)

Hello

Do you know how to calculate in AutoCAD statical moment (cm^3)

of the selected coordinate system. Best for any figure (region)

statical moment.jpg

Edited by jan_ek
Posted

Massprop give you the results.

You need to make a solid from the shape, thickness = 1 or 1000. Or a region can be used i think.

Then set ucs right and rotate it if required. You then can calculate and check the centroid, set ucs right again?

And then it gives you the static moments.

 

 

 

https://knowledge.autodesk.com/support/autocad/learn-explore/caas/CloudHelp/cloudhelp/2015/ENU/AutoCAD-Core/files/GUID-CAA51229-293E-4A0C-BFF3-93226252CF13-htm.html

Posted

Hello

I think that the function massprop provide moments of inertia (cm^4), I am looking for Statical moment (cm^3)

Posted

I thought to write a lisp

1. Rotate the figure and in relation to the selected coordinate system and move to 0,0,0

2. divides the object into two parts by an axis

3. creates a region

4. calculates the center of gravity (massprop) and field

5. multiplies, and stores the result

6. Repeat for the second axis

7. Returns to its original position and entered values and will draw the axes for which counted

Unfortunately for me, this is too complicated. Can anyone help

Posted

Maybe autocad is not the best tools.

MathCAD or Maple have more possibilities for doing calculations and making it visual i think.

Or inventor? .. Maybe someonse else got a good idea ..

Posted

Hello

This is exactly what I wrote.

The only difference is that it is made for a simple solid.

Following a step-by-step manual, function working.

The main difficulty for me is to store it in a Lisp function.

You have to create new objects based on the point of intersection etc.

For the less it is too complicated so I asked for help :).

Posted

Hi jan_ek

The calculus is very simple. It just require to sum the product between area and the distance from centroid to the axis, for each object.

What I didn't quite understand is the "selected coordinate system".

This is my interpretation of the problem.

The objects must be regions, in the current UCS.

The first point is the origin of the coordinate system and the second point is the X direction. The Y direction is 90deg rotation of Ox, counterclockwise.

Works well in WCS and in any UCS rotated in xOy plan.

;Static Moment
;Stefan M. - 07.08.2016
(defun C:STM ( / rot a c e i o reg ss sx sy v x y u p)
 (defun rot (p u)
   (list
     (+ (* (car  p) (cos u)) (* (cadr p) (sin u)))
     (- (* (cadr p) (cos u)) (* (car  p) (sin u)))
     )
   )
    
 (if
   (and
     (setq ss (ssget '((0 . "REGION"))))
     (setq o (getpoint "\nSpecify coorditate system origin: "))
     (setq x (getpoint o "\nSpecify X direction: "))
     )
   (progn
     (setq u (angle o x)
           sx 0.0 sy 0.0
           reg (ssadd))
     (repeat (setq i (sslength ss))
       (setq e (ssname ss (setq i (1- i)))
             v (vlax-ename->vla-object e))
       (if
         (not
           (vl-catch-all-error-p
             (setq c
               (vl-catch-all-apply
                 'vlax-get
                 (list v 'centroid)
               )
             )
           )
         )
         (setq a  (vla-get-area v)
               p  (rot (mapcar '- c o) u)
               sx (+ sx (* a (cadr p)))
               sy (+ sy (* a (car p)))
         )
         (ssadd e reg)
         )
       )
     (princ "\nSx = ") (princ (rtos sx 2 2))
     (princ "\nSy = ") (princ (rtos sy 2 2))
     (if
       (> (sslength reg) 0)
       (progn
         (princ "\nInvalid region(s) found")
         (sssetfirst nil reg)
         )
       )
     )
   )
 (princ)
 )

Posted

Works correctly.

The ideal would be to just knew how to divide a lump of x-axis and y-axis and create a region.

I'm not sure how well it explained.

"Sy" should be calculated for a body defined by the division of the y-axis and "SX" by dividing the x-axis.

Of course, using your function now you can do it but the full machine would be ideal :)

Posted

By the definition, static moment is sx=sum[a(i)*y(i)]. For anything else please post a sample with the shapes, axis and results.

Posted

Everything is correct

I have enclosed a sketch he can explain what I mean

m02.jpg

Posted

Almost clear. In your very first post you have an image with the axis origin on top left corner. Obviously, in that case sx1/=sx2. Can you clarify this for me, please?

And one more question, in the last sample, what are you looking for? The axis for which the equality is true?

Posted (edited)

It probably was not the best sketch.

This sketch is only valid if the layout of coordinates coincides with the principal axes of the object.

 

I would need 4 data Sx (above and below the axis) and Sy (left and right side of the axis) for any arbitrary coordinate system and the object.

Edited by jan_ek
Posted

The new task is quite different than you specify in OP. I might have an idea but you should consider a professional software or pay someone to write the lisp for you. Good luck.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...