Author Topic: Standard DesignCAD Keyboard Shortcuts  (Read 25019 times)

The Scud

  • Hero Member
  • *****
  • Posts: 747
Re: Standard DesignCAD Keyboard Shortcuts
« Reply #15 on: November 28, 2015, 02:15:47 PM »
F12 is I am out but the TMO says I am not.
BETA man and proud Kiwi. aka Steve The Kiwi
Supreme writer of DesignCAD Tutorials
Toshiba L50 Laptop - It is OK.
Intel i5-337U @1.8GHz, 12 gig RAM, 64 Bit Win 10
Intel HD Graphics 4000 NVidia GeForce GT 740M
Desktop AMD A8 R7 64 bit Win 10 with Quadro K620

JJG

  • Hero Member
  • *****
  • Posts: 715
Re: Standard DesignCAD Keyboard Shortcuts
« Reply #16 on: November 29, 2015, 12:26:43 AM »
another question :
when F12 is reaffected to other command, how to assign it's first action (moving dimension text through all possible positions) to another key ?

samdavo

  • Hero Member
  • *****
  • Posts: 2587
  • the trick is knowin...^ > v < - which way's up?
Re: Standard DesignCAD Keyboard Shortcuts
« Reply #17 on: November 29, 2015, 02:21:45 PM »
F12 is I am out but the TMO says I am not.
Thanks Scud but (lol)
Can you say that it again in a little less sophisticated way please? :)

Alternatively
I believe you are saying that the F12 method of "cycling through options for dimensions" is no longer available. Pls confirm.

I am guessing  that the dimension format (typically  5 point for simple linear dimensions) is different to what it used to be, and hence the F12 no longer works.

PS Ahhh - Bdecks' reply #23 here refers i.e. making reference to changes to the dimension format in V18.
http://forum.designcadcommunity.com/index.php?topic=6416.msg45949;boardseen#new

I only have V22 to V25 available on my current computer - nothing prior to that to check against / compare.

Cheers. 
« Last Edit: November 29, 2015, 02:25:43 PM by samdavo »

Pearco

  • Hero Member
  • *****
  • Posts: 823
Re: Standard DesignCAD Keyboard Shortcuts
« Reply #18 on: November 29, 2015, 04:12:08 PM »
Guys;

F12 still cycles through some of the different text positions, but not all that it did in V14 and earlier. In my opinion, I wish it was never changed.
Jim
User since ProDesign 1.5

Dr PR

  • Hero Member
  • *****
  • Posts: 5378
Re: Standard DesignCAD Keyboard Shortcuts
« Reply #19 on: November 29, 2015, 07:03:05 PM »
Pearco,

I agree. I can no longer get the dimension text to go where I want it.

Phil
DesignCAD user since 1987

bdeck

  • Hero Member
  • *****
  • Posts: 780
Re: Standard DesignCAD Keyboard Shortcuts
« Reply #20 on: November 30, 2015, 09:57:55 AM »
F12 is missing from Dempsey's list. It moves dimension text through all possible positions.

Actually, I cant recall  F12 ever being used to edit dimension text, only to adjust text during execution of the dimension command. (maybe in version 6?)

Below is preliminary macro to edit text position of an existing selected dimension or selection set. If no selection, works on the last entity drawn.  Just a preliminary cobbling of old code into a single macro, but already way simpler than the info box.

It brings up a menu of 3 keys that may be used to cycle or toggle through 3 different text position and orientation parameters.

Escape, Enter, or Click to exit.

WARNING: Assigning the F12 key to a macro  permanently disables F12 function in the dimension command. (for now, anyway)

Code: [Select]
'f12a.d3m   version 0.01  bdeck  11/15

' Preliminary macro to cycle horizontal and vertical dimension text positions
' and toggle flipped text status. 
' Works on entire selection set or last entity drawn
' If assigned to f12 key, f12 must be avoided during dimension drawing commands.
' NOTE: In this version, if more than one dimension is selected,
' each dimension will be cycled from its own starting point.


Alias ENT_SELECTED &H010C
Alias D_TEXTPOSITION_HOR &H0A15
Alias D_ENABLEFIXEDTEXTPOS &H0A18 
Alias D_SETTEXTFLIPPED &H0A19
Alias D_TEXTPOSITION_VER &H0A14 
Alias ENT_POINT  &H010E 
Alias ENT_NPTS  &H010D

Fkey=asc("F")
Vkey=asc("V")
Hkey=asc("H")
Lkey=asc("L")
escapekey=27
enterkey=13
mbutton=1

verno = left$(sys$(105),4)
if verno < 18 then gosub bail

sys(470)=1  ' prevent other commands


gosub main
end

main:
ne=sys(9)
ns=sys(80)
if ne=0 then end
do while (k<>escapekey) and (k<>enterkey) and (k<>mbutton)
print "Text:  H=cycle horzn posn, V=cycle vert posn, F=flip  .... enter,esc,click = EXIT"
anykey k
if k= Fkey then gosub ftoggle
if k= Hkey then gosub hcycle
if k= Vkey then gosub vcycle
regen
loop

return


hcycle:


if ns = 0 then
entno = ne
gosub hcheckit
else
    for entno=1 to ne
entity entno
query ENT_SELECTED, issel
if issel=1 then gosub hcheckit
    next entno
endif
return

hcheckit:
getattr entno,type
if (type=75) or (type=79) then gosub hchngit
return


hchngit:

entity entno
Change D_ENABLEFIXEDTEXTPOS, 1
update
entity entno
Query D_TEXTPOSITION_HOR, textpos 
textpos = textpos+1
if textpos>4 then textpos=0
if textpos<0 then textpos=0
Change D_TEXTPOSITION_HOR, textpos
update

return



vcycle:


if ns = 0 then
entno = ne
gosub vcheckit
else
    for entno=1 to ne
entity entno
query ENT_SELECTED, issel
if issel>0 then gosub vcheckit
    next entno
endif
return

vcheckit:
getattr entno,type
if (type=75) or (type=79) then gosub vchngit
return

vchngit:
entity entno
Change D_ENABLEFIXEDTEXTPOS, 1
update
Query D_TextPosition_Ver, textpos
textpos = textpos+1
if textpos>2 then textpos=0
Change D_TextPosition_Ver, textpos 
update
return

ftoggle:
 
if ns >0 then gosub fliplist
if ns <1 then gosub fliplast  ' if none selected get last entity drawn 
regen
return

fliplist:
for i=1 to ns
Getselect i, entno
GETATTR entno,type
gosub dimtest
next i
return

fliplast:               'Optional routine to flip text of last element drawn, if it is a dimension
if ne <1 then end
entno=ne
GETATTR entno,type
gosub dimtest
return

dimtest: ' is it a dimension that can be flipped?
if (type >73) and (type<82) then gosub flipit
return

flipit:
entity entno
query D_SETTEXTFLIPPED, qf
cf=1-qf
change D_SETTEXTFLIPPED, cf
update
return

bail:
message "Macro requires DC Version 18.0 or higher"
end
return

« Last Edit: November 30, 2015, 07:54:26 PM by bdeck »

Dr PR

  • Hero Member
  • *****
  • Posts: 5378
Re: Standard DesignCAD Keyboard Shortcuts
« Reply #21 on: November 30, 2015, 10:37:29 AM »
BD,

I think you are correct. In older versions F12 adjusted the positions of parts of the dimensions, cycling through each possible position so you could see what the results look like. But this worked only while the dimension was being created. I used these all the time, especially the function that cycled through all possible text positions. When we lost this after the AutoCRUD compatibility conversion I could no longer create dimensions effectively. It was extremely frustrating - and still is!

****

The DesignCAD V15 Reference Manual lists the following function key functions during dimension creation:

F12: "The F12 key may be used to toggle through the text locations without opening the Dimension Text window." This moved the text to the middle of the dimension line, above center, below center, end, above end, below end, etc.

Shift F12: "The Shift+F12" keys may be used to toggle through the dimension formats without opening the Dimension Text window." This changed the way the numbers were displayed (decimal fractions, foot/inch/fraction, etc.).

Ctrl F12: "The Ctrl+F12 keys may be used to toggle through the text orientations without opening the Dimension Text window. The Shift+Spacebar keys may be used to 'flip' the text." This rotated the text horizontal/vertical or aligned with the angle of the dimension, right side up or upside down.

So, using F12 and Ctrl F12 you could cycle the dimension text to all possible positions and orientations very quickly. And because the old dimensions had many more options for text position and orientation these F12 functions produced very nice looking dimension text.

****

The V18 Reference Manual lists the same Shift/Ctrl/F12 key functions. But because the new AutoCRUD compatible dimensions do not have as many possible combinations of position and orientation, more often than not the dimensions look lousy. I usually end up exploding the dimensions and editing the parts manually to get the text aligned properly. The AutoCRUD compatible dimensions were a big step backwards.

Phil
DesignCAD user since 1987

bdeck

  • Hero Member
  • *****
  • Posts: 780
Re: Standard DesignCAD Keyboard Shortcuts
« Reply #22 on: November 30, 2015, 02:13:59 PM »
If the f12 key is assigned to a macro, and if the f12 key is pressed while the dimension command is executing, the dimension command fails to prevent the macro from executing.

Edit: JJG seems to have discovered this already. F12 is initially assigned to mystery function 9686. After assigning it to a macro, I have no clue how to reassign it to 9686.
« Last Edit: December 07, 2015, 07:29:19 PM by bdeck »

Dr PR

  • Hero Member
  • *****
  • Posts: 5378
Re: Standard DesignCAD Keyboard Shortcuts
« Reply #23 on: November 30, 2015, 02:29:15 PM »
Need to think about this a bit. Two functions for the same key (combination)? Let's see, if it's Tuesday of an odd-numbered month and the sun is shining F12 does this, or if ...

Phil
DesignCAD user since 1987

bdeck

  • Hero Member
  • *****
  • Posts: 780
Re: Standard DesignCAD Keyboard Shortcuts
« Reply #24 on: November 30, 2015, 02:43:31 PM »
Need to think about this a bit. Two functions for the same key ...

One Key, One function, two contexts.

If you are in the midst of drawing a dimension, the key should be handled by the dimension command.

Otherwise, the key should be handled as a shortcut to the dimension editing macro.

What's to think about?

Dr PR

  • Hero Member
  • *****
  • Posts: 5378
Re: Standard DesignCAD Keyboard Shortcuts
« Reply #25 on: November 30, 2015, 03:50:44 PM »
Well, I didn't interpret what you said that way.

What if F12 is assigned to a macro that has nothing to do with dimensions? Say a macro to delete the entire drawing?

There really aren't many restrictions to what can be assigned to F12 or any other key (combination).

So, assigning a macro to a key that has an existing function basically has to remove the existing function from the key, or else that key would have two different functions. Which should be executed when? That is certain to cause confusion!

One option is to prevent default key assignments from being changed within DesignCAD functions. That way F12 would keep it's assigned functions for dimension creation. It might have a different function when the program is not in the middle of some other process.

I suspect having multiple functions assigned to a single key (combination) would require a total rewrite of the keyboard handling routines. So the question is whether DT and company want to try to deal with multiple function assignments for a single key (or key combination) and whether it is worth the programmer time and debugging time.

Phil
DesignCAD user since 1987

bdeck

  • Hero Member
  • *****
  • Posts: 780
Re: Standard DesignCAD Keyboard Shortcuts
« Reply #26 on: November 30, 2015, 11:00:19 PM »
Warning: Dont reassign the F12 key before reading this.

Hi Phil,

All good points. No argument here.

So, assigning a macro to a key that has an existing function basically has to remove the existing function from the key, or else that key would have two different functions.

While the statement above may not be inherently true, it is certainly true in the current instance. 

The F12 key has no published function outside the context of the dimension command. It is not documented to be assigned as a shortcut key (except that prior to assigning it to a macro, it is reported to be "Currently used: 9686". )

Once the key has been reassigned (for example to a macro), the internal F12 function (related to the dimension command) is permanently disabled. Merely removing the assignment to the macro is not enough to get back F12 functionality in the dimension command.  (any ideas?)

Whether or not this feature should be "fixed" hinges on whether we can use it to our advantage.

I guess that's something about which to think. (apologies to Winston Churchill)

Best Regards,

BD
« Last Edit: December 07, 2015, 07:41:43 PM by bdeck »

JJG

  • Hero Member
  • *****
  • Posts: 715
Re: Standard DesignCAD Keyboard Shortcuts
« Reply #27 on: December 01, 2015, 10:31:08 AM »
If the f12 key is assigned to a macro, and if the f12 key is pressed while the dimension command is executing, the dimension command fails to prevent the macro from executing.

This should be fixed. There is no reason why the f12 key should not be assignable as a shortcut key, and still work properly within the context of the dimension command.

Edit: JJG seems to have discovered this already. F12 is initially assigned to mystery function 9686. After assigning it to a macro, I have no clue how to reassign it to 9686.
Yes, indeed !

DrollTroll

  • Kindly Curmudgeon
  • Administrator
  • *****
  • Posts: 4091
Re: Standard DesignCAD Keyboard Shortcuts
« Reply #28 on: December 01, 2015, 10:37:49 AM »
Quote
F12 is initially assigned to mystery function 9686. After assigning it to a macro, I have no clue how to reassign it to 9686.
Save the keyboard file in .dka format.
Open in a text editor.
Set the F12 key back to command ID 9686 and save.
Load the .dka file into DesignCAD and save as default.
2016 marks my 24th year in DesignCAD-Land!

JJG

  • Hero Member
  • *****
  • Posts: 715
Re: Standard DesignCAD Keyboard Shortcuts
« Reply #29 on: December 01, 2015, 10:50:40 AM »
OK, done.

Thanks a lot !

I don't know why I have not thought to it, as I did such way for other commands ; but the trick was to know the ID "9686".
Again, thanks !