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.

Arrow size with dimension diameter

Started by Bob P, September 24, 2013, 08:42:44 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Bob P

Ver. 23:
Sys(462) doesn't seem to effect the arrowhead size of dim-diameter or dim-radius.  Is there a new sys function for those?  Nothing listed (that I could find) in the V21 docs.  I have the linear dimensions set up to size the arrowheads proportional to the text size.

Added Note: I see that V23's DC_dimension.ini file has separate values for the arrow sizes, so I expect that there's a new sys for those...

Bob P

Well, I guess there's no sys function assigned to those arrows.  :-\  I gave a weird value to each arrow size and searched for it using my syschk.d3m macro and it came up with nothing.  Hopefully, in the next DC version, they'll assign something to cover them.  I skip back and forth between drawings whose size can vary dramatically, and I'd rather not have to waste my time manually changing the arrowhead sizes between drawings.

(FWIW, here's the macro.  It does work with other valid sys functions.)

'Checks for a system number that has an unusual value (1.111)
precision 4
OPEN "O", 1, "SYS.LST"  'Creates a file in your macro folder
FOR J=1 TO 6000
if j>88 and j<102 then goto skip 'I skip some sys functions that require something selected or are irrelevant.
if j>288 and j<300 then goto skip
if j>389 and j<400 then goto skip
X=SYS(J)
if x=1.111 then
PRINT #1, "SYS(",J,")=", X
end if
skip:
NEXT J

CLOSE 1
END:

Lar

Put a sample dimension of each type off to the side somewhere and when starting a different type use the 'same as' finger (in the dimension command dialog) on the type you want. You will be able to draw that type of dimension until you change it (using the 'same as' finger or manually). <<since you're switching between drawings forget the samples and just use the same as finger on a dimension already in the drawing>>

Lar

samdavo

bludy good idea Lar -
or (likewise) load up a stack of options in a "symbol" drawing.

Bob P

An interesting workaround, but since I do almost everything from the command line or shortcut keys, it really breaks my flow.  IMHO, the later versions of DC have "broken" some valuable core scripting options.

bdeck

#5
Testing in version 15 I find that sys(462) returns a scale factor in version 15 (accoreding to the SDK Macros17.hlp file ) but in versions 17-20 sys(462) returns an arrow size.

A reliable way to preset parameters for dimensions is with the macro (or a limited part of it) posted by RobS here: http://forum.designcad.com/index.php?topic=1047.0

Rather than preset the sizes of text and arrowheads for individual dimensions, I often find it easier to edit existing dimensions, individually or in bulk, knowing that I'll have to do it on some dimensions anyway.

Here is a macro to change text and arrow sizes on dimensions, standard text, arrows, balloons, and pullouts. Its a little more inclusive than i would normally prefer.  To reduce its scope, various sections may be edited away.

PS:  Although I prefer to specify a scale factor generally, an absolute arrow size is more versatile on a single drawing. That is, even if multiple dimension text sizes are to be used on the same drawing, the multiple arrow sizes that result from using a common arrow scale factor will sometimes look goofy, where a common arrow size does not.

Also, some work needs to be done to deconstruct balloons, scale the circle, and reassemble the circle, arrow, and text if balloon text is to be edited or resized well.

' dta04.d3m   10/2013  bdeck version 04

'Changes text size and/or arrow size or scale for users choice of
'  last drawm,
'  selected items, or
'  all entities

' works for dimensions, text, pullouts, balloons, and arrows


'*********  Global Constants ***************
true=1
false=0


' ********  preset flags  **************************

bap=false ' flag to allow changing arrows and/or text of balloons, pullouts, pullouts and arrows
tflag= false ' flag to allow changing of text size in non-dimensional entities
' (including ballons and pullouts)

'Note: when changin only the last item drawn, bap and tflag are automatically set to true.
'Note: when changing a selection of 4 or fewer entities (eg one balloon), bap and tflag are automatically set to true.


'*********  Global variables ***************
Alias T_SIZE  &H0502
Alias D_TEXTSIZE   &H0A04
Alias D_ARROWSIZE   &H0A03
Alias ENT_SELECTED  &H010C
Alias ENT_TYPE  &H0101
Alias AW_SIZE   &H0903
Alias ENT_GROUPINDEX  &H0115 


n=sys(9)    ' no of entities
ns=sys(80)  ' no of selected entities



' ********  initialize vars  **************************
tsize=false      ' flag to change text size
dascale=false ' flag to change arrow scale
dasize=false ' flag to change arrow size
gn=0 ' group number of final entity


'*********  Primary Data Input  ***************

input "new text size", ts$
if sys(999)=1 then end
ts=val(ts$)
if (ts$>"") and (ts>=0) then
tsize=true
endif

input "new arrow scale", dasc$
if sys(999)=1 then end
dasc=val(dasc$)
if (dasc$>"") and (dasc>=0) then 
dascale=true
endif

if dascale=false then input "new arrow size", dasz$

if sys(999)=1 then end
dasz=val(dasz$)
if (dasz$>"") and (dasz>=0) then
dasize=true
endif


if (tsize=false) and (dascale=false) and (dasize=false) then
message "no changes to arrrows or text,   ending"
end
endif

'******* text and / or arrow size preset global vars *************

if tsize=true then
dts=ts                ' dimension text = standard text size
if dascale=true then 
dasz=dts*dasc 'calcualate arrow size from text and scale factor
endif
endif


'*************  change last item only ? ******************

entity n         'look at last entity drawn
gosub typchek
if (dort = true) then  'is entity either dimension or text?
input  "Change Last Item Only?  1=yes, default=no  ",q$
if Sys(999) =1 Then end  ' cancel OR ESC
if q$="1" or q$="y" or q$="Y" Then      'yes response
bap=true
tflag=true
if gn=0 then
gosub changeit 
else                   ' else last item is in a group
    for i=0 to 4
        j=n-i
entity j
Query Ent_GroupINDEX, g
if (g=gn) then gosub changeit
next
endif
Regen
end
endif
endif

'*************  change selected items only ? ******************

If ns > 0 then

input  "Change Selected Items Only?  1=yes, default=no  ",q$
if Sys(999) =1 Then end  ' cancel OR ESC
if q$="1" or q$="y" or q$="Y" Then      'yes response
sonly=true   ' change text only for selected items
if ns<5 then
bap=true
tflag=true
endif
else
sonly=false  ' change text regardless of selection status
endif
endif


'*************    Main Loop    ************************************

for i=1 to n      'look at all entities
  entity i
  Query Ent_Selected, eselected
  if (sonly=false) or (eselected=true) then
gosub changeit 
  endif
next i

REGEN
end

'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

changeit:

' Note: it is not nexessary to type check every entity. Changes apply only where applicable.
if tsize=true then
Change D_TEXTSIZE, dts
if tflag=true then Change T_SIZE, ts   'changes non-dimension text size also ***   OPTIONAL  ****
else
if dascale=true then  'rescale arrows for existing text
query D_TEXTSIZE, dts
dasz=dts*dasc
endif
endif

        if (dascale=true) or (dasize=true) then
Change D_ARROWSIZE, dasz
if bap then Change AW_SIZE, dasz  ' Optional change arrows, pullout arrows, and balloon arrows
endif
update
return

typchek:
        entity n
Query Ent_TYPE, tt
Query Ent_GroupINDEX, gn
if (gn<1) and (tt<>34) then
gosub finalcheck
else
    if tt=34 then gn=sys(91)   'for groups in later versions
for i=0 to 3    ' pullouts and balloons have only 3 or 4 entities to check
        j=n-i
entity j
Query Ent_GroupINDEX, g
if g=gn then
gosub finalcheck
if (dort = true) then i=3
endif
next i
endif
return

finalcheck:
Query Ent_Type, t
dort=false
dtype=false
ttype=false
if (t>70) and (t<82) then  dtype =true    'is entity a dimension?
if (t=24) then atype true 'is entity an arrow
if (t=3) or (t=13) or (t=22) or (t=119) then ttype=true  'is it text?
if (dtype =  true)  or (ttype=true) or (t=24) then dort = true
return