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.

Data table

Started by j-wetzel, May 08, 2013, 09:21:58 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

herbertjackson


I found this old micro.  You can edit it to fit your needs



'BILL FOR 2D




A = SYS(12)
IF SYS(1) = 0 THEN GOSUB SETIT
GETXY X, Y
BX = A * 60
>LINE
{
<POINTXYZ [X, Y, Z]
<POINTXYZ [X - BX, Y, Z]
}

A$ = "BILL  OF  MATERIAL"
C = A * 1.75
D = A * 2.5
>TEXT
{
<POINTXYZ [X - (BX / 2), Y - C, Z]
<POINTXYZ [X - (BX / 2), Y - C, Z]
<TEXT [A$]
}
>LINE
{
<POINTXYZ [X, Y - D, Z ]
<POINTXYZ [X - BX, Y - D, Z]
}
AGAIN:
INPUT "HOW MANY TEXT LINES " L
IF L = 0 THEN GOTO AGAIN
>POINTSELECT
{
<POINTXYZ [X - BX, Y -D, Z]
}
FOR T = 1 TO L + 1
'D = D + (A * 2.5)
>PARALLEL
{
<POINTXYZ [X - BX, Y - D, Z]
D = D + (A * 2.5)
<POINTXYZ [X - BX, Y - D, Z]

}

NEXT

>LINE
{
<POINTXYZ [X - BX, Y - D, Z]
<POINTXYZ [X - BX, Y, Z]
}
>LINE
{
<POINTXYZ [X, Y - D, Z]
<POINTXYZ [X, Y, Z]
}

'
DY = A * 2.5
CX = A * 55
>LINE
{
<POINTXYZ [X - CX, Y - DY, Z]
<POINTXYZ [X - CX, Y - D, Z]
}

CX = A * 49
>LINE
{
<POINTXYZ [X - CX, Y - DY, Z]
<POINTXYZ [X - CX, Y - D, Z]
}
CX = A * 28
>LINE
{
<POINTXYZ [X - CX, Y - DY, Z]
<POINTXYZ [X - CX, Y - D, Z]
}

CX = A * 17
>LINE
{
<POINTXYZ [X - CX, Y - DY, Z]
<POINTXYZ [X - CX, Y - D, Z]
}

AA = A * 4.25
CX = A * 59
>TEXT
{
<POINTXYZ [X - CX, Y - AA, Z]
<TEXT "QTY"
}
CX = A * 54
>TEXT
{
<POINTXYZ [X - CX, Y - AA, Z]
CX = A * 43
<TEXT "MARK"
}
CX = A * 48
>TEXT
{
<POINTXYZ [X - CX, Y-AA, Z]
<TEXT "DESCRIPTION"
}
CX = A * 27
>TEXT
{
<POINTXYZ [X - CX, Y - AA, Z]
<TEXT "LENGTH"
}
CX = A * 16
>TEXT
{
<POINTXYZ [X - CX, Y - AA, Z]
<TEXT "NOTES"
}
>REGENERATE
{
}


END
SETIT:
SETPOINT "SET A POINT AT THE UPPER LEFT CORNER" 1
IF SYS(1) = 0 THEN GOTO SETIT
CLS
RETURN

samdavo

#16
Quote from: herbertjackson on May 12, 2013, 09:11:28 PM

I found this old micro.  You can edit it to fit your needs
WOWO - bludy brilliant Herbert!
and easily changed as you say,
thanks
sam

PS I notice it draws 3D text - easily converted for a paperspace, but maybe that's not even necessary for paperspace.  ( sorry I should check it and give you a definitive answer on that).

It would also be better if the lines at least were grouped - (or otherwise selected so that you could immediately group them) - but again easily done as a second step (well semi-easily lol.

- and I'm not sure I know how to group things in a macro lol.
cheers.

samdavo

#17
ok I've checked that in paperspace, and absolutely no problem with it being 3D text.
but with an A4 drawing, it was a massive table .

You have to draw it off to the side, (i.e. pick a point below and/or to the left in paperspace) because, being ungrouped, if you paste the macro-ed table into the drawing margins, the individual lines are difficult to select (without picking up other elements of the paperspace), to group and then to shrink to fit.  ( and we're talking about 10% or maybe 5% of that macro'ed size for an A4).

I suppose you could group everything in Paperspace before adding the table, then at least you wouldn't have loose ends of the table in amongst the views etc (2 cents) - and you can make a group of the table to shrink it , move it, place it , etc.

PS I find that works pretty well :) - i.e. make a group of everything on the Paperspace - protects it whilst you add tables and other "new additions"

samdavo

#18
Herbert
I've re-jigged your macro a bit
' Instead of choosing table width to be 60 times the text size, chose text size to be 1/60th of the preferred table size
And I enclose two tables, one 300mm wide ( bx = 300 being the first input)
and one 50mm wide ( bx = 50) more suitable for paperspace.
(or 3 inches whatever if you prefer)
cheers and thanks again

I also enclose a jpeg of a table drawn DIRECTLY into paperspace, (3 inches wide), using this macro - which I call TABLE2.d3m.  ( 2 cents)
'BILL FOR 2D - TABLE2.d3m
' Instead of choosing table width to be 60 times the text size, chose text size to be 1/60th of the preferred table size

Input "total width = ?" , bx
a = bx/60
sys(12) = a

'A = SYS(12) cancel this line
IF SYS(1) = 0 THEN GOSUB SETIT
GETXY X, Y
'BX = A * 60 cancel this line
>LINE
{
<POINTXYZ [X, Y, Z]
<POINTXYZ [X - BX, Y, Z]
}

A$ = "BILL  OF  MATERIAL"
C = A * 1.75
D = A * 2.5
>TEXT
{
<POINTXYZ [X - (BX / 2), Y - C, Z]
<POINTXYZ [X - (BX / 2), Y - C, Z]
<TEXT [A$]
}
>LINE
{
<POINTXYZ [X, Y - D, Z ]
<POINTXYZ [X - BX, Y - D, Z]
}
AGAIN:
INPUT "HOW MANY TEXT LINES " L
IF L = 0 THEN GOTO AGAIN
>POINTSELECT
{
<POINTXYZ [X - BX, Y -D, Z]
}
FOR T = 1 TO L + 1
'D = D + (A * 2.5)
>PARALLEL
{
<POINTXYZ [X - BX, Y - D, Z]
D = D + (A * 2.5)
<POINTXYZ [X - BX, Y - D, Z]

}

NEXT

>LINE
{
<POINTXYZ [X - BX, Y - D, Z]
<POINTXYZ [X - BX, Y, Z]
}
>LINE
{
<POINTXYZ [X, Y - D, Z]
<POINTXYZ [X, Y, Z]
}
'
DY = A * 2.5
CX = A * 55
>LINE
{
<POINTXYZ [X - CX, Y - DY, Z]
<POINTXYZ [X - CX, Y - D, Z]
}

CX = A * 49
>LINE
{
<POINTXYZ [X - CX, Y - DY, Z]
<POINTXYZ [X - CX, Y - D, Z]
}
CX = A * 28
>LINE
{
<POINTXYZ [X - CX, Y - DY, Z]
<POINTXYZ [X - CX, Y - D, Z]
}

CX = A * 17
>LINE
{
<POINTXYZ [X - CX, Y - DY, Z]
<POINTXYZ [X - CX, Y - D, Z]
}

AA = A * 4.25
CX = A * 59
>TEXT
{
<POINTXYZ [X - CX, Y - AA, Z]
<TEXT "QTY"
}
CX = A * 54
>TEXT
{
<POINTXYZ [X - CX, Y - AA, Z]
CX = A * 43
<TEXT "MARK"
}
CX = A * 48
>TEXT
{
<POINTXYZ [X - CX, Y-AA, Z]
<TEXT "DESCRIPTION"
}
CX = A * 27
>TEXT
{
<POINTXYZ [X - CX, Y - AA, Z]
<TEXT "LENGTH"
}
CX = A * 16
>TEXT
{
<POINTXYZ [X - CX, Y - AA, Z]
<TEXT "NOTES"
}
>REGENERATE
{
}

END
SETIT:
SETPOINT "SET A POINT AT THE UPPER LEFT CORNER" 1
IF SYS(1) = 0 THEN GOTO SETIT
CLS
RETURN


PS referring to that jpeg of "table drawn directly into paperspace" -
a) I first selected everything (Ctrl+A) and made a group
b) I then ran the macro to paste in that table, choosing bx = 3 inches
c) I then selected the table dragging the rubberband around it, and grouped it separately
d) then moved it to where I wanted it - could have expanded it I guess - not important
e) I then made it visible from behind the paperspace views.

Lol, and again I find it strange that you have to highlight what you want to move FORWARD...

and select "Move to BACK" to make it visible!!  lol

samdavo

#19
Now to work out how to populate that with attributes and material lists - and from with the macro?

or does that happen automatically when you use Material List command?
(personally I usually try to avoid them - or do Parts Lists from first principles, including counting the bolts et on a drawing etc).

Presumably there are some good threads around here on the subject of material lists ?

I notice (searching this forum for the keyword "attribute" that you get thee SYS functions ( whatever they mean ?)

21 - Attribute display enable/disable [0 = Don't display, 1 = Display]
........
261 - Draw attributes in current color
262 - Draw attributes in current layer
263 - Default attribute layer

Also a stack of old threads !!
ahh , so much to learn, and so little time to learn it :)

As these Welsh kids say, (worth a listen if you have time - BBC recording btw)
"there's more to see that can ever be seen, more to do that can ever be done..
there's far too much to take in here, more to find that can ever be found, 
but the sun rising high, in a sapphire sky
keeps great and small on the endless round etc etc. " :)

http://www.youtube.com/watch?v=jbg_g6GVDzY

samdavo

PS I meant that the table should be automatically populated from within the macro - maybe with a few prompts such as:-

"You want part #01 listed"? etc"   Y , and part #01 attribute properties ripple across that row.   
"You want part #02 etc"
Maybe even draw it upside down, which is the common way these Parts Lists are drawn ?

The other improvement - talking about the General DATA Table case now - as per this thread title - would be if it added some dummy text such as a dot (".") or even a space ("  ") at the first position of text within each cell - to let you easily insert text at correct location.   Alternatively a construction line or set of lines that was easily deleted later, that joined all such points either column wise , or row-wise - or even both.   All pretty obvious.     

I'll have a crack at it tonight - unless someone beats me to it.

But clearly the best improvement (in the case of a Parts/Material List) would be to add those attributes - and I would need to do a heap of study there.   Might need a legup as they say.
cheers
sam


j-wetzel

I have followed the discussion my question/complaint prompted with considerable interest, but my problems with math symbols in labels on DCad drawings are a bit different.  Wingdings don't help me at all.  The sorts of things I need to built, symbol-by-symbol, by picking the necessary symbols from appropriate fonts and inserting them, placing them by hand one at a time, look more or less like the attached.  Their construction seems to require a full-blown math editor, or at least an editor that allows more control over symbol placement than free-form adjustment by hand with a mouse (or whatever).
--Jack

prl

#22
Quote from: j-wetzel on September 07, 2013, 10:02:05 AM
Their construction seems to require a full-blown math editor, or at least an editor that allows more control over symbol placement than free-form adjustment by hand with a mouse (or whatever).

I guess in a crunch I would simply draw the various integral symbols and assemble the equation visually in DCAD.   Do it enough and you should be able to collect a DesignCAD "goby" file of various mathematical symbols with upper and lower limits, summation ranges,  (text place holders) etc. and do cut and paste.  Call it the original MathCAD.  Probably what you've been doing already.

John R

It would be nice if you could use HTML code in a drawing, instead of chasing your tail going through various fonts. I think HTML has all the symbols and text you might need. This is what I was able to cobble together between code and formatted text (sup, sub, italics, etc). There are various sites that have pages devoted to Math symbols, such as the one at W3Schools. I don't have DesignCAD (just TC), so I'm not sure if this is already possible or not.
My 2¢ to the 'cause'. ☺

&#0966; =  φ
&#8747; =  ∫
&#8320; =  ₀
&#8495; =  ℯ

φ(x) = ∫x₀  t sin² (t + ℯt) dt
John R.

Dr PR

Jack,

I haven't followed all of this discussion, and it has been a long time since I looked through every font in Windows to see if math symbols are available, but I seem to recall that some of the fonts did have them at one time.

So, are you aware that you can paste symbols into text in DesignCAD? The "standard" way of opening the Windows font program and cutting/pasting into DesignCAD is a pain in the kiester, but it works (mostly). I streamlined it a bit by assigning the font editor to a symbol in my user defined toolbox in DesignCAD.

I assigned "charmap.exe" to a button with the "key" symbol (one of the button caps available in DesignCAD). Just open "Options/Toolbox" and select your custom toolbox. Select the "Executables" option from the "Categories" list, change the directory to wherever charmap.exe is loaded on your computer (somewhere within the Windows files) and use the Add button to put charmap.exe in your custom toolbox. There is a list of symbols you can assign to the toolbox button.

****

Having said this, I tried the Windows "Symbols" font, which shows some math symbols in the character map. When I paste them into ordinary text or a text block they appear as something entirely different. Same thing happens with the "Symath" font. However, with other font sets (CountryBlueprint, CityBlueprint) I do get some symbols to paste correctly into DesignCAD.

So you might be able to find or create a character set of math symbols that will paste into DesignCAD - but I wouldn't bet on it.

Phil


DesignCAD user since 1987

herbertjackson

If you are looking for math simples, try these, they can be copied and inserted
Or look for other sights on the web for math simples