fatabass Posted December 23, 2010 Share Posted December 23, 2010 Hi, Thanks in advance for those who will try to help me with this problem. I have lots of rectangles and i need to find the coordinates of the centroid of these and put them in Autocad. It takes ages to use massprop or finding them by dimensions manually. Is there any shortway to put them automatically inside them? Thank you. Sorry for bad english, not mother tongue. Quote Link to comment Share on other sites More sharing options...
Tyke Posted December 23, 2010 Share Posted December 23, 2010 Are these rectangles already in AutoCAD or are they somewhere else? Are the rectangles formed from 4 lines or are they polylines that are closed? Are all the rectangles parallel to either the X or Y axes? Quote Link to comment Share on other sites More sharing options...
fatabass Posted December 23, 2010 Author Share Posted December 23, 2010 Are these rectangles already in AutoCAD or are they somewhere else?Are the rectangles formed from 4 lines or are they polylines that are closed? Are all the rectangles parallel to either the X or Y axes? Thank you for your interest. Rectangels are formed from 4 lines and i drew them using the command REC and then i make them Regions for using massprop, but not neccesery, i can leave them as i drew with "rec" command. These rectanguler are all in a drawing right now, all of are both parallel to X and Y axes. What I do right now is i draw Xlines parallel to Y and X axes, starting from point 0,0 and then i measure each of these rectangules centroids relative to these lines and find the centroids. It takes ages. What I need is: a node in the centroid of all these rectangles. coordinates of these nodes. (seen on autocad if possible like X : 3455.. Y : 4445 ) and areas of these individual rectangles. Thank you. Quote Link to comment Share on other sites More sharing options...
Tyke Posted December 23, 2010 Share Posted December 23, 2010 Try placing a point in the centre by setting object snap to Endpoint and giving the command Point, then type "m2p" and select two diagonally opposite corners of the rectangle. The point command will remain active so you just need to repeat "m2p" and pick the two corners for each rectangle, when you're done press escape to end the point command. You'll need to set the point style to something appropriate to what you are doing. Quote Link to comment Share on other sites More sharing options...
fatabass Posted December 23, 2010 Author Share Posted December 23, 2010 Try placing a point in the centre by setting object snap to Endpoint and giving the command Point, then type "m2p" and select two diagonally opposite corners of the rectangle. The point command will remain active so you just need to repeat "m2p" and pick the two corners for each rectangle, when you're done press escape to end the point command.You'll need to set the point style to something appropriate to what you are doing. Thanks but it says unknown command m2p Quote Link to comment Share on other sites More sharing options...
ReMark Posted December 23, 2010 Share Posted December 23, 2010 Re: Centroid. Did you see this thread? http://www.cadtutor.net/forum/showthread.php?24528-Lisp-to-find-Center-of-Gravity Quote Link to comment Share on other sites More sharing options...
Tyke Posted December 23, 2010 Share Posted December 23, 2010 @ ReMark: that's a cute little link ;-)) Quote Link to comment Share on other sites More sharing options...
Tyke Posted December 23, 2010 Share Posted December 23, 2010 @ fatabass : have you started the point command BEFORE typing m2p? Quote Link to comment Share on other sites More sharing options...
ReMark Posted December 23, 2010 Share Posted December 23, 2010 There's more out there re: centroid but I thought I'd stay closer to home this time. Quote Link to comment Share on other sites More sharing options...
ReMark Posted December 23, 2010 Share Posted December 23, 2010 @ fatabass : have you started the point command BEFORE typing m2p? MTP or M2P (both work) is a command modifier. It must be used after a command is started otherwise one gets the invalid command error response. Quote Link to comment Share on other sites More sharing options...
fatabass Posted December 23, 2010 Author Share Posted December 23, 2010 MTP or M2P (both work) is a command modifier. It must be used after a command is started otherwise one gets the invalid command error response. Thanks m2p works fine but i need to see the coordinates of that point too. I will try to learn how to use those codes in the link you have provided. Thanks. Quote Link to comment Share on other sites More sharing options...
ReMark Posted December 23, 2010 Share Posted December 23, 2010 So you are going to attempt to write your own lisp program? Quote Link to comment Share on other sites More sharing options...
fatabass Posted December 23, 2010 Author Share Posted December 23, 2010 So you are going to attempt to write your own lisp program? I do not know how to write lisp programs. What I need is to see the coordinates of the centroid of the rectangle in Autocad in text, in the drawing and also the area of the rectangle. I tried the lisp in the link you provided (gecen) but it did not work, I do not know why. Quote Link to comment Share on other sites More sharing options...
ReMark Posted December 23, 2010 Share Posted December 23, 2010 There are ways to obtain the area of a rectangle and have it displayed using a lisp routine. There are also other lisp routines for obtaining the centroid of a rectangle or a polygon. You just have to put some effort into tracking them down. I have not come across one routine that will do both though. Quote Link to comment Share on other sites More sharing options...
eldon Posted December 23, 2010 Share Posted December 23, 2010 You could always try inserting Fields Quote Link to comment Share on other sites More sharing options...
fatabass Posted December 23, 2010 Author Share Posted December 23, 2010 You could always try inserting Fields inserting fields? Quote Link to comment Share on other sites More sharing options...
fatabass Posted December 23, 2010 Author Share Posted December 23, 2010 There are ways to obtain the area of a rectangle and have it displayed using a lisp routine. There are also other lisp routines for obtaining the centroid of a rectangle or a polygon. You just have to put some effort into tracking them down. I have not come across one routine that will do both though. Thanks for your interest and help ReMark. Where can I search for those lisps and what keywords would help me finding them ? Quote Link to comment Share on other sites More sharing options...
ReMark Posted December 23, 2010 Share Posted December 23, 2010 I would search using something like this (type it just as you see it). "centroid"+"lisp" You can also take a hike over to the Cadalyst magazine website and do a search in their CAD Tips section. You'll find plenty of free lisp routines. An example of what one can find at Cadalyst is this: http://cadtips.cadalyst.com/mass-properties/center-line-gravity Quote Link to comment Share on other sites More sharing options...
ReMark Posted December 23, 2010 Share Posted December 23, 2010 Total length and total area lisp program by forum member extraordinaire Lee Mac can be downloaded for free here: http://lee-mac.com/totallengthandarea.html Seek and ye shall find. Quote Link to comment Share on other sites More sharing options...
eldon Posted December 23, 2010 Share Posted December 23, 2010 inserting fields? This is all done by Fields from the Insert menu. But lisp is good too. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.