OSMODE
2
(the above sets midpoint Osnap, do it any other way if you want)
LINE
.X
(pick the X direction part of a closed Pline Square or Rectangle)
.YZ
(pick the Y direction of a closed Pline Square or Rectangle)
now you are in the center of the square or rectangle to start the LINE (or
whatever command).
Enjoy.
--
Dean Saadallah
http://www.pendean.com
LT Express Utilities
http://www.pendean.com/ltexpress
Expanded Links Pages
http://www.pendean.com/lt/links.htm
--
Midpoint of drawn line will be at the center of the square or rectangle.
I t would be nice if a square/rectangle had a midpoint shown as well as
the four corners when it is selected.
--
Len Rafuse
Vision Engineering
circe wrote:
> Is there an easy way to find the center of a square, rectangle or
> other straight-sided polygon without first drawing intersecting
> perpendicular lines from the sides' midpoints? (Something similar to
> the snap-to-center for circles.)
> Thanks.
>
> Ruth
(defun c:plc (/ aq-DocObj aq-vlaObject aq-SafeArray aq-Region aq-Centroid)
(setq aq-DocObj (vla-get-activedocument (vlax-get-acad-object)))
(setq aq-vlaObject (vlax-ename->vla-object (car (entsel))))
(setq aq-SafeArray (vlax-make-safearray vlax-vbObject '(0 . 0)))
(setq aq-SafeArray (vlax-make-variant (vlax-safearray-fill aq-SafeArray
(list aq-vlaObject))))
(setq aq-Region (vla-addregion (vla-get-modelspace aq-DocObj)
aq-SafeArray))
(setq aq-Region (vlax-safearray-get-element (vlax-variant-value aq-Region)
0))
(setq aq-Centroid (vlax-safearray->list (vlax-variant-value
(vla-get-centroid aq-Region))))
(vla-delete aq-Region)
aq-Centroid
)
Command: line
LINE Specify first point: 'plc
--
Joel Roderick
www.caddevelopmentgroup.com
"Phantomdrafter" <phantom...@yahoo.com> wrote in message
news:Xns933E5F9A7F2D...@64.124.46.110...
> Or
>
> (Defun BETWEEN (/ A B)
> (Setq
> A (GetPoint "\n1st Point: ")
> B (GetPoint A "\n2nd Point: ")
> )
> (MapCar
> '(Lambda (I J) (/ (+ I J) 2))
> A
> B
> )
> )
>
"Scott F." <scottfe...@hotmail.com> wrote in message
news:AD43E661E1D03D8D...@in.WebX.maYIadrTaRb...
set up toolbuttons with
'cal;(cur+cur)/2;; (midpoint between two points - using current osnaps)
'cal;(cur+cur+cur)/3;; (triangle centroid - using current osnaps
--
Jamie Duncan
"Maybe the Hokey Pokey is REALLY what's it all about"
"Ian A. White" <ianw...@wAi.com.au> wrote in message
news:2v727vkflq0kcrtmg...@4ax.com...
> On Thu, 13 Mar 2003 14:06:09 -0800, circe <ruth_er...@cei.com>
> wrote:
>
> >Is there an easy way to find the center of a square, rectangle or other
straight-sided polygon without first drawing intersecting perpendicular
lines from the sides' midpoints? (Something similar to the snap-to-center
for circles.) <BR>
>
> You can use the Geometric Calculator by entering 'cal in response to a
> point, then for the expression you can use MEE (for Midpoint between two
> endpoints), the pick the endpoints.
>
> For a triangle you can use (end+end+end)/3, and expand this for other
> figures.
>
> For rectangles/squares aligned with the current UCS, you can also use
> point filters and use .X and .Y of appropriate midpoints.
>
> --
>
> Regards,
>
> Ian A. White, CPEng
> WAI Engineering
> Sydney 2000
> Australia
>
> Ph: +61 418 203 229
> Fax: +61 2 9622 0450
> Home Page: www.wai.com.au
Just out of curiosity, is this to draw middle justified text in the
rectangle? or is it to add geometry? or just to inquire it's location?
*******************************************************
Please, DO NOT send technical requests to me via private e-mail
*******************************************************
Tracy W. Lincoln, Assistant Moderator
Autodesk Discussion Groups Forum Moderator Program
Discussion Group Links:
Index: http://discussion.autodesk.com
Rules: http://discussion.autodesk.com/webx?groundrules
Product Support: http://support.autodesk.com/
Sharing the information is what is is really all about!
I want something like this:
...
...running AutoLISP routine...
Specify insertion point: 'mdpt <--- THIS baby is what I'm after (to add to
my POP0 menu)
Specify first point:
Specify second point: <--- at this point, 'mdpt kicks out the
sought after mid point.
...AutoLISP routine continues on its way...
As it stands right now, trying to do this using 'CAL MEE; or 'CAL
(cur+cur)/2; in my POP0 menu results in this:
...
...running AutoLISP routine...
Pick Insertion Point and Rotation: 'CAL
Point or option keyword required. <--- CHOKE!
Specify insertion point or [Scale/X/Y/Z/Rotate/PScale/PX/PY/PZ/PRotate]:
... <--- Yes, the routine continues, but I can't get the point I need.
I would sincerely like to know how to do acomplish this.
Regards,
David Kozina
Chris.
"David Kozina" <djko...@t-3.cc> wrote in message
news:015D0B81E6468195...@in.WebX.maYIadrTaRb...
^C^C-MTEXT;\J;MC;
This assumes (and you can write it into the macro) that you have a
running OSNAP using ENDpoint and/or INTersection and that your current
text style and last used text height is what you need.
Modified to set ONSAPs:
^C^COSMODE;33;-MTEXT;\J;MC;
Modified to set a specific TEXTSIZE & TEXTSTYLE (my text style is
called LABEL and the height I am setting is 0.5)
^C^COSMODE;33;TEXTSTYLE;LABEL;TEXTSIZE;0.5;-MTEXT;\J;MC;
I would assume a LISP programmer could have you specify the two corners
of the rectangle and loop this in easily and/or create one that leaves
you at the center of the rectangle.
The nice thing about this macro is if you double-click edit it will
stayed centered in the box.
Now for getting to the center for objects. Isn't this place great? All
the methods being prescribed are good ones. The longer you use AutoCAD
the more ways you find to do something...
I like using
'CAL;MEE
You can create a button, so it can be used transparently with any other
command looking for a point.
Always a good topic... but the replies that say eyeball it (are users
who use the default left justified text and move it) (are HACKERS!!)
*******************************************************
Please, DO NOT send technical requests to me via private e-mail
*******************************************************
Tracy W. Lincoln, Assistant Moderator
Autodesk Discussion Groups Forum Moderator Program
Discussion Group Links:
Index: http://discussion.autodesk.com
Rules: http://discussion.autodesk.com/webx?groundrules
Product Support: http://support.autodesk.com/
Sharing the information is what it is really all about!
BTW, there have been requests for this for, oh, at least 8 years or so - and
though it would seem (to me) to be a simple thing to add to the core program
(compared with intersect osnap, fer instance, or even the newer parallel
osnap added recently) our requests seem to have fallen on deaf ears at
Autodesk.
Some have apparently been able to accomplish this via simple arx programming
(all the more reason for Autodesk to add it to the program it seems to me),
but, as I don't know how to program in arx, such solutions seem to lie,
tantalizingly, just out of the reach of my abilities.
One other option (not yet mentioned) is to actually go through and add such
a 'midpoint-2-point-pick' option to all our existing routines whenever a
point input is requested (then it would always be available, see?) - and
although I HAVE considered going this route, I currently seems to be a 'low
rate of return for effort expended' type thing.
So, for now, I wait and hope that maybe in AutoCAD 2006 or 2010 - or at
least before I reach retirement age, someone's lightbulb will go one at
Autodesk and we'll actually see this simple improvement.
Best regards,
David Kozina
"OLD-CADaver" <rc...@chicagobridge.com> wrote in message
news:f14e2...@WebX.maYIadrTaRb...
Good Luck, you wouldn't ask fer much wouldja?
Graeme
"David Kozina" <djko...@t-3.cc> wrote in message
news:015D0B81E6468195...@in.WebX.maYIadrTaRb...
OK, then.
In the example depicted above,
how could I find the midpoints
"o" btwn the vertices "+" using
transparent tracking?
Assume *any* angle and *any* width
for the different segments.
(I realize it is a rough ascii
sketch and does not depict the
vertices and midpoints correctly,
but it should be enough to illustrate
one example of what I need to do.)
(Creating offset construction midlines
is not the option I'm desiring.)
Sincerely curious,
David Kozina
"Graeme Hyslop" <ghy...@quinndressel.com> wrote in message
news:63A1E25A3E3816C4...@in.WebX.maYIadrTaRb...
The only way I could figure it transparently would probably take too long to
be worthwhile and it's not gonna be 100% accurate.
If you do the distance command first and get the x and y between the 2
endpoints and divide them by 2 and then use track command and enter those
numbers for your x and y distances. It's not always gonna give you exactly
the midpoint though even at 8 decimal places.
Graeme
"David Kozina" <djko...@t-3.cc> wrote in message
news:3807591AB0886BFA...@in.WebX.maYIadrTaRb...
<sigh>
"Graeme Hyslop" <ghy...@quinndressel.com> wrote in message
news:92E0D15DD654B7B2...@in.WebX.maYIadrTaRb...
I loaded up the lisp then (following copied from text window):
Command: line
Specify first point: 'plc
Invalid point.
Specify first point:
Any one else have this problem? Or should it be loaded in a special way?
regards,
Dave P.
"Joel Roderick" <jroderickatcaddevelopmentgroup.com> wrote in message
news:C1B401CB4BF14E8C...@in.WebX.maYIadrTaRb...
*******************************************************
Please, DO NOT send technical requests to me via private e-mail
*******************************************************
Tracy W. Lincoln, Assistant Moderator
Autodesk Discussion Groups Forum Moderator Program
Sharing the information is what IT is really all about!
Draw a square on the default layer zero, with each side of one unit length.
Save it with a reasonable name and a centre base insertion point (you could
wblock it if you want picking the centre of the square as the insert point)
and use it as a block insert for ever after.
To make a rectangle of 200 x 700, you simply insert this generic block and
input the scale factors you need. Being a block, there will be a GRIP bang
in the centre of the block, regardless of x and y scal factors, so you just
move the rectangle about using the centre grip.
If you want, you can explode the block, but why bother? Done once, this wee
block will serve you well for many years!
DCD
PS you can use this basic drift for pipe ends, duct ends, circular or rect
etc.
"Dean Saadallah" <in...@NOSPAMpendean.com> wrote in message
news:956A4F59BD959FE0...@in.WebX.maYIadrTaRb...