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.

Number Fill

Started by seemack, February 05, 2015, 05:21:17 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

seemack

Hi all,

Is there a standard feature to automatically fill in numbers. E.g when numbering electrical terminals, start at 1 then fill down to 50 with an increment of 1?

Many thanks for any help.

DrollTroll

Nothing built-in. Probably this could be done with a BasicCAD script.
25 years with DesignCAD

samdavo

#2
Seemack
This is not answering your question, but still might be helpful.
It is a macro called "table2.d3m", which draws a table for a Bill of Qtys, eg a total width set to 1000, and say 10 lines  (and I apologise, but I forget who wrote this).   You have to set a point (after those inputs) and it will locate the table there.

I imagine it would not be difficult to add numbers to the rows of such a table (and include this in the macro) - with consecutive numbers

... and copy these numbers to various balloons maybe?
... see better method next post

Cheers
sam

PS You can also import tables including numbers and text from Excel as I recall

samdavo

Or maybe load this dcd as a symbol, together with balloons already numbered which can be moved as required (2 cents)

DrollTroll

Try this macro.

First, press 'Q' to open the Options command, and check in the "File Locations" tab to see where DesignCAD looks for macros by default.
Download the attached .d3m file to that folder.

Then, use Tools/Macro Execute to run "BalloonsByNumber.d3m".
It'll first ask you for the balloon diameter, the arrow size, and the starting number. A message will then pop up reminding you to press "Esc" to end the macro at any time.
Then it'll start drawing balloons with consecutive numbers.

25 years with DesignCAD

samdavo

#5
DT
Do you need a text size in that macro as well?
I suspect you assume text size is 1 (?)

PS Certainly works well in terms of consecutive numbers.

One minor tip (to others), but if you set 3 points for a balloon, then pressing Shift as you set the third point will give a horizontal line into the circular balloon (2 cents).

PS I suppose it has always been the case with DCAD that the size of the text changes between 9 and 10 - and not easily amended?  (talking V22.1 here)  (edit),  ok,  provided you set the diameter of the circle as 4 or larger, (and text size 1) then the text size doesn't change between 9 and 10   (well, it changes from 1.00 to 0.99 - no biggie)

samdavo

#6
DT
Here's a slightly modified version of that macro (called BalloonsByNumber V22.d3m) - mainly
a) the defaults are changed, balloon size is 4.1  (so that a "9" is the same text size as a "10)
b) arrow size is still 0.5, BUT
c) inside the macro, arrow size is changed to 0.5 x (text size).

or rather "as = as x text size",  and "as" = 0.5 by default, assuming you don't use something else.

It works pretty well with V22.1 (using defaults)
but it is all over the place with V24  (?) - i.e. you can get a seriously different size of text and balloon on the second balloon compared to the first (?) - especially if you start the numbering at 9, i.e. 9 is massive, 10 is miniscule.
i.e. choose 9 as the number to start with, and compare it to 10.


JJG

Hi all,

In case of error(s) in your list of Nr (or in your balloon's numbering, etc ...), the following code allows you to change some text_Nr step to step (incrementing them )in your drawings, just and simply by successively clicks on them.
enjoy !

'JJG 03.2010
'This macro allows you to renumber some Nr of balloon, Nr, page Nr, texts etc ...
'simply click successively on the desired texts, balloons, etc ... or groups or improper solids containing a text,
'which will then be replaced by an incremented index after each click.

sys(996) = 1 'Enhanced Esc Key Behavior
PID = sys(1174)   'Store "Automatically pack Group IDs and Solid IDs" on Save. [0 = no, 1 = yes].
sys(1174)=0 'Sys(1174), when set to 1, is currently conflicting with some save operations within BasicCAD.
'We suggest for now that if your macro is going to save a drawing, your macro 'code should set Sys(1174) to zero and use
'the >PackGroupIDs and >PackSolidIDs commands (if so desired) before saving a file.

Alias T_TEXT   &H050A 'This parameter allows you to access the text contents of the text entity

sys(1027)=1 ' message box style = OK/Cancel
message "This macro retrieves one after the other texts (normally Nr... !) ",Chr$(13),"by a new number, which is incremented step by step.",Chr$(13),"Attention, this action is not undoable through ctrl Z ..."
if sys(1028)=2 then end
message " For precaution, the drawing is going to be save :",Chr$(13),"to undo the action of the macro,close the drawing without saving it, and re-load it"
if sys(1028)=2 then end

STORE:
INPUT "from which number should the renumbering start ?  (Esc to quit)", Nr$
IF sys(999) THEN End 'stop the macro if esc or cancel

'save for precaution, to allow the possibility to undo at the end of the action of the macro
>Save
{
  }
sys(80)=0 'deselect all
sys(1174)=PID 'restore sys(1174) statment


mes$="click on the desired entity containing the Number to be change (Esc to leave the macro)"
message mes$

Select:
>PointSelect
{
  <Incomplete
  <Type 0
  }

If sys(80)<1 then goto fin

nbent=sys(80) ' Sys(80) is the number of entities currently selected
for t=1 to nbent
getselect t,j
entity j
  Change T_Text, Nr$
  Update
Next j

sys(80)=0

REGEN

Precision 0

Nr = Nr$
Nr = Nr+1
Nr$ = Nr

goto Select

fin:
inf$="Please, you have to click on the desired entity containing the Number to be change ! (restart the macro)"
message inf$
end


;)

samdavo

JJG
Neat :)   You can change the text of a balloon without exploding the group.  cheers

JJG

yes, it's just much much easier and much much much faster than via the infobox ...
;)

impulse

#10
Presented for your number line drafting enjoyment...nline.d3m

This was originally done to do just as the original poster asked... write sequential numbers for terminals. Over the ensuing years I added improved capabilities ("feature creep"). There was a time when I was doing a lot of XY graphs of data and the extended capabilities were primarily there to expedite the labeling of X & Y axis

In it's simplest form the user enters:
A distance to move between numbers horizontally
and/or
A distance to move between numbers vertically
Either entry can be a negative number...if you enter a value in both, then the numbers will be placed diagonally.

if both are Hzntl & vertical offsets entries are zero (left blank) then it calls a routine to calculate the offset between numbers by setting 2 points. (Many times I want to put numbers inside an array of boxes, I use the point mode to find the distance by setting the lwr lft corner of the first two boxes)


Next you are prompted for a Text size, hit Return to use the Default size.

Then you are asked for Prefix label...for instance "T-" would result in "T-1 T-2 T-3" and so forth... hit Return to enter nothing.


Then you are prompted for a starting value ie: "1" and and ending value ie:"6",
Next It asks for the units between values...normally this would be 1 (and the program defaults to that) but you can put decimal values as well. For instance, setting units at ".5" will result in 12 values between 1 and 6 ie "1.0 1.5 2.0 2.5...   
You dont have to number up from start to end you could number from 10 to 1 ....just be sure to put a negative step value or you may get an infinite counter!   (10 + 1 = 11 and wont get to 1 !)


This was last edited in 2002!, you will notice the comment at the head of the program " 'sequential numbering for 2d 6.0 seems to work " as in DCAD for DOS version 6.0! I am amazed that it still works after all these years/version updates.
There is little error checking.  If you enter a non numeric value for Hznt or vertical distance or units between numbers, it will probably blow up. Remember too, that if you choose a fractional units between values that it would also make sense to set the decimal precision to something that corrssponds appropriatley.

As I wrote this instruction note, I could see where some reordering of user parameters would be  prudent. I really think it should be...

X, Y spacing
Start Value
Stop Value
Units between numerical values
Decimal precision of numerical values
Text Size
Prefix

Maybe I'll freashen up the code if there is any interest.

There was also some code in there at the end to select all of the numbers generated so that they could be repositioned as a group or deleted if redoing was required. The code was commented out of operation...I can recall if that was because it failed in some way or if it was too much a nuisance.

Anyway..hope nline.d3m serves someone, feel free to edit to suit your purposes or improve. 

-jimpulse

samdavo

#11
thanks jimpulse 
Sure to come in handy one day.  (PS eg the matrix in the jpeg took only a few minutes)
Quote from: impulse on February 07, 2015, 06:50:59 AM
...  you could number from 10 to 1 ....just be sure to put a negative step value or you may get an infinite counter!   (10 + 1 = 11 and wont get to 1 !)
Sounds like you can prove once and for all that Einstein was wrong when he (allegedly - maybe) said -  "if you stare in one direction for long enough, you will eventually see the back of your head"  :)
maybe ...
If iteration >100 then
message "oops,  mayday, compass malfunction!" 
end
?

or maybe decide   test that (number of) "Steps" must be positive , viz 
STEPS= INT ((ENDVAL-STRTVAL)/UNTVAL)

STEPS= ((ENDVAL-STRTVAL)/UNTVAL)
If Steps < 1 then
message "oops, UNTVAL must be same sense +ve or -ve as Startval to Endval, hence end"
end
end if


PS IYDMMSS If you don't mind me saying so, it also needs an "Esc" ejection seat in the event of a screwup lol - maybe you don't screw up, but I do. eg

INPUT "ENTER HRZNTL DISTANCE BETWEEN NUMS. (or esc to quit) " HORZSTP
If Sys(999) Then
End
                         end if


see Nline2.d3m

DrollTroll

Quote from: samdavo on February 06, 2015, 03:24:45 PM
but it is all over the place with V24

Well, quite frankly, I think we need to "pop" the Balloon command as it currently exists and start over from scratch (or at least add a new version that does most of what everyone wants on a consistent basis). The behavior of Balloon has varied in one way or another throughout the years, usually never quite hitting that magic "sweet spot".
25 years with DesignCAD

seemack

Hi to all,

Many thanks to all for your replies. I really appreciate the efforts.

jimpulse - your macro is pretty much spot on for my needs. Thanks. I can certainly use it as it is.

regards chris

Dr PR

DT,

Here is a suggestion. Way back in the 80s I used a program called Schema to create electronic schematics. It is common in schematics to have "buses" of multiple signals with related functions, like address buses, data buses, etc. These would be labeled A0, A1, A2, ..., An.

Schema allowed us to create a basic symbol (like a balloon) to indicate signal direction and include a template text element. Then we could just array it and have the text element increment by a defined increment count (+1, +5, -3, whatever). Unfortunately, most (all) more recent schematic capture programs are pretty brain dead and have few of the sophisticated drawing functions that the 1985 Schema for MS/DOS had.

In the picture the elements on the left are examples of the type of symbols we could create, where "NN" is a template text element. On the right is an example of how the top left symbol can be used to create a bus for eight symbols arrayed close together, with the text starting at "A0" and incremented +1 for subsequent elements. We could also just step and repeat the text element without having any associate lines.

The text element could be A0, A000, TEST10, whatever. It would be up to us to create a set of enclosing lines/curves, etc., large enough to enclose the longest text string that we want to use.

In effect it is a "smart" array function that allows substitution of a base text string for the template string (A0 in this example) and then incrementing the string by a defined increment. It would work with any collection of lines, curves, etc, just like the Array function, except that you could include only one template text string, and it must end in a number. Only the number part is incremented/decremented. Any alphanumeric characters preceding the number would be treated like a prefix for the number.

Phil
DesignCAD user since 1987