Community
AutoCAD Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Drawing Rectangles

9 REPLIES 9
Reply
Message 1 of 10
kgrupenhof
518 Views, 9 Replies

Drawing Rectangles

Seems simple, I know, but I'm having trouble consistently drawing rectangles.  I draft a lot of mechanical piping (specifically in Civil 3D because we also do pipelines) and I typically use rectangles to draft the pipe rather than two lines so I can easily move, adjust lengths, etc.  

 

I have always dropped in a flange, or something with the pipe OD, and created a rectangle based on that.  I use Object Snap Tracking to track the opposite side of the flange and manually enter my pipe length through the keyboard.  99/100 times it'll draw the rectangle with the correct OD and length, but every once in a while some setting changes and it instead draws the pipe to have the diagonal length match my keyboard entry.  Pictures below for reference.

 

My question is - what setting causes it to do this?  I've searched far and wide for the last couple years, intermittently as it occurs, to try to find a solution.  Eventually it fixes itself and I go on with my life, but it still bugs me.

 

Started rectangle at top of weld neck of flange, using bottom of flange to track to the right, enter 1.5 [ft] on keyboardStarted rectangle at top of weld neck of flange, using bottom of flange to track to the right, enter 1.5 [ft] on keyboardThe result, the diagonal of the rectangle is 1.5 ft.  Normally it makes the length 1.5ft and the width matches the flange weld neck.The result, the diagonal of the rectangle is 1.5 ft. Normally it makes the length 1.5ft and the width matches the flange weld neck.

9 REPLIES 9
Message 2 of 10
pendean
in reply to: kgrupenhof

That occasional problem could be a running osnap catching a point you don't want... .
Message 3 of 10
kgrupenhof
in reply to: pendean

But there's nothing out there that it could snap to.  When I say it happens intermittently, I mean it'll happen consistently for a week or more until it randomly reverts back.  Then a month or so later it'll start again.  Which leads me to believe it's some setting that gets reset or somehow modified.

Message 4 of 10

Hi,

 

besides of what @pendean already mentioned with the incorrect base-point for tracking I would like to ask:

 

>> I draft a lot of mechanical piping (specifically in Civil 3D

>> because we also do pipelines)

When you have Civil 3D, why then drawing pipes with rectangles, why don't you use Civil 3D functionality to draw pipes?

 

Even without Civil 3D I would never draw rectangles (at least because I don't have a length of objects and I can't mamipulate lenth and width easily) instead I would:

  • use a dynamic block (for width and length)
  • use _MLINE (>>>details<<<)

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2024
------------------------------------------------------------------------------------

(not an Autodesk consultant)
Message 5 of 10

Civil 3D's pipes are really designed for what we do, to my knowledge.  A single drawing could have thousands of short pipe sections to build pipe settings.  We use alignments for long sections of buried pipe (i.e. pipelines) and rectangles for short (i.e. 6" to 5') pipes within settings.

 

I understand the _MLINE and dynamic blocks, but they're honestly more trouble than my traditional method of using rectangles.  Each take multiple key entries to define the width (i.e. diameter) of the pipe - a step that isn't necessary when I snap to adjoining pipe or fittings.

 

What I'm really after is how to make the rectangle command do what I want it to.

Message 6 of 10
scot-65
in reply to: kgrupenhof

I am leaning towards the MLINE method.

Perhaps one can build a dialog where one can select different
(diameters) pipe size, provide justification and go from there...

-or-
Specify 2 points which represent the diameter of the pipe (with
an option to accept as is) and drag for the third point...

???

Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.


Message 7 of 10
dlanorh
in reply to: kgrupenhof

I have a lisp that draws polyline rectangles that might help. It was written for metric drawings and requires a distance and the selection of the top left and bottom left points of the rectangle, it then calculates the the other two points based on the angle of top left to bottom left and the supplied distance.

I am not one of the robots you're looking for

Message 8 of 10
kgrupenhof
in reply to: scot-65


@scot-65 wrote:
Specify 2 points which represent the diameter of the pipe (with
an option to accept as is) and drag for the third point...

 

That is precisely what the rectangle command does for me most of the time.  

Message 9 of 10
kgrupenhof
in reply to: dlanorh

That would be great if you could post it!  Thanks.

Message 10 of 10
dlanorh
in reply to: kgrupenhof

Sorry about the delay, I missed your post.

 

Here is the code.

 

(vl-load-com)
;;draws a polyline rectangle to the right of the selected points
(defun c:rect (/ *error* osm c_doc p_dist pt1 pt2 p_ang pt3 pt4)

  (defun *error* ( msg )
    (if osm (setvar 'osmode osm))    
    (if (and c_doc (= 8 (logand 8 (getvar 'UNDOCTL)))) (vla-endundomark c_doc))
    (if (not (wcmatch (strcase msg) "*BREAK*,*CANCEL*,*EXIT*")) (princ (strcat "\nOops an Error : " msg " occurred.")))
    (princ)
  );_end_local_*error*_defun

  (if (/= (getvar 'osmode) 1) (progn (setq osm (getvar 'osmode)) (setvar 'osmode 1)));save current osnap mode and set to end if not already end
  
  (setq c_doc (vla-get-activedocument (vlax-get-acad-object)))

  (initget (+ 1 2 4));No null,zero or negatives
  (setq p_dist (getreal "\nEnter Rectangle Length : "));get length as decimal units
  
  (if (and c_doc (= 8 (logand 8 (getvar 'UNDOCTL)))) (vla-endundomark c_doc))
  (vla-startundomark c_doc)

  (initget 1);no nulls
  (setq pt1 (getpoint "\nSelect Top Left Corner : ")
        pt2 (getpoint "\nSelect Botton Left Corner : ")
        p_ang (+ (angle pt1 pt2) (* pi 0.5))
        pt3 (polar pt2 p_ang p_dist)
        pt4 (polar pt1 p_ang p_dist)
  );end_setq
  (command "_pline" pt1 pt2 pt3 pt4 "c");draws lwpolyline on current layer
  (if osm (setvar 'osmode osm))
  (if (= 8 (logand 8 (getvar 'UNDOCTL))) (vla-endundomark c_doc))
);end_defun

I am not one of the robots you're looking for

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report