News:

Please note new Forum URL: forum.designcad.com

Main Menu
DesignCAD 3D Max 2027 box
Now available

DesignCAD 2027

Hatches that follow their boundaries, an on-screen dial to turn your model, and a way to find any command by name, in a clean Windows 11 look.

xyz coordinate dimensioning macro

Started by Bob P, November 07, 2013, 11:23:31 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Bob P

I thought someone had done this already, but I can't find it.

Set (snap to) the first point in 3D (or 2D) space.
Set a second point where you want the text. i.e. (xdim, ydim, zdim)

I find that the native dimension-coordinate pretty useless in 3D since it seems to orient the text at random.  Not to mention it takes 3 operations to dimension a single point...

I have an old DOS macro, but it needs a complete rewrite.

Dempsey

I don't have a macro like you described, but I am wondering about the understanding of dimension coordinate.

My understanding is that the first point is the base point, 2nd point is the to be measure point, and the 3rd point determines the text location, followed by 4th and 5th, etc..

Moving the cursor up or down after the 2nd point determines X dimension. Moving the cursor left or right after the 2nd point determines Y dimension. I had to read the Help to understand that too.
Dempsey

Bob P

The way it works in my V23:  The first point is the base point, the second is the point to be measured, the third direction defines the delta x, delta y, or delta z direction and forces the text in that direction.  It does not allow a fourth point to orient the text.

Dempsey

Let me see if I understand you.

The way I see it is that the text is shown perpendicular to the delta you are measuring. So you are saying that you like to angle the text differently using a 4th point? Suppose the text is angled 45o in a 2D drawing; how does someone know what is being measured?

Dempsey

samdavo

#4
Not confident this answers your question Bob, but I recently posted a jpeg where the text is aligned based on the third point's position relative to the second.   

Try holding
Shift (X),
or Ctrl (Y),
or both (Z)

as you move the cursor to set the third point - (or use point relative to set the third point).

The macro could use Point Relative of course.

Bob P

#5
Sam,

That's what I've been doing, but the results <bad word>.

Here's a screenshot.  Some of the x-axis dims are basically unreadable.


DrollTroll

Hmmm. Yes, you're right -- it appears to be rotating the text into some sort of "baseplane" that includes the dimension's "origin", the measurement point, and the "direction" point.
At worst, I'd expect all X dimensions to be parallel to one plane (xy), all Y dimensions to be parallel to one plane (probably xy) and all Z dimensions to be parallel to one plane (xz or zy, maybe -- what would you suggest?).
25 years with DesignCAD

Bob P

Once I figured how to manipulate the values into a text string, the macro wasn't too hard.  I really prefer this format to DC's method.  Try it out in a drawing.  It works as written in a 2D drawing, but includes a z-value.  That can be easily changed.

'pdim.d3m
'Creates text in the format "(xval, yval, zval)" of the point set
'For a 2d drawing, see Note
                       
SETPOINT "Set a point at the point to be measured" 1   
pointval xp, yp, zp, 1
xp$=xp
yp$=yp
zp$=zp
xyzval$="("+xp$+", "+yp$+", "+zp$+")"
'*Note*
'for 2D xyzval$="("+xp$+", "+yp$+")"
>text2D
{
<style 1
<Justification 0
<Font "Arial"
<Angle 0
<text [xyzval$]
}
end

DrollTroll

So you're wanting absolute XYZ coordinates, not offsets from some starting point?
25 years with DesignCAD

Bob P

Yes.  Absolute XYZ values.  For various references, I move the origin around.  For instance, I sub'd a machining job with holes at irregular intervals in the XY (horizontal) plane.  The machinist could set his Bridgeport readout at zero, then manually move the table to my hole-center values (or use those values for his CNC program).

For my latest application, I needed to give a bunch of 3D points to someone else so that they could enter them into a proprietary program.  Frankly, exporting a 3D DXF did not look encouraging, and I'd rather not give that much info anyway.

samdavo

Another thing I'll add - a tip from PRL in fact (wonder what he's up to these days  :) ) - anyway, He suggested "why not try simple Vector Font instead of True Type Font". 

As a result of that post, I use that almost exclusively these days.  - much clearer  :)   cheers, and if you see prl before I do, please say g'day - and thanks.