Autocad - Algemeen
Uitleg
De cijfers op het numpad worden omgezet naar AutoCAD functies
Gebruikte functies
~ = Enter
Programma
Kopieer onderstaande tekst naar LuaMacros
----------------------------------------------------
-- assign logical name to macro keyboard
lmc_assign_keyboard('MACROS');
-- define callback for whole device
lmc_set_handler('MACROS',function(button, direction)
if (direction == 1) then return end -- ignore down
----------------------------------------------------
if (button == 97) then -- Numpad 1
lmc_send_keys ('ARC') -- draw an arc
lmc_sleep(100)
lmc_send_keys ("~") -- Enter
----------------------------------------------------
elseif (button == 98) then -- Numpad 2
lmc_send_keys ('CIRCLE') -- draw a circle
lmc_sleep(100)
lmc_send_keys ("~") -- Enter
----------------------------------------------------
elseif (button == 99) then -- Numpad 3
lmc_send_keys ('LINE') -- draw a line
lmc_sleep(100)
lmc_send_keys ("~") -- Enter
----------------------------------------------------
elseif (button == 100) then -- Numpad 4
lmc_send_keys ('PLINE') -- draw a polyline
lmc_sleep(100)
lmc_send_keys ("~") -- Enter
----------------------------------------------------
elseif (button == 101) then -- Numpad 5
lmc_send_keys ('RECTANG') -- rectangle
lmc_sleep(100)
lmc_send_keys ("~") -- Enter
----------------------------------------------------
elseif (button == 102) then -- Numpad 6
lmc_send_keys ('MOVE') -- move
lmc_sleep(100)
lmc_send_keys ("~") -- Enter
----------------------------------------------------
elseif (button == 103) then -- Numpad 7
lmc_send_keys ('DONUT') -- Draw a solid donut shape
lmc_sleep(100)
lmc_send_keys ("~") -- Enter
----------------------------------------------------
elseif (button == 104) then -- Numpad 8
lmc_send_keys ('DIST') -- Check a distance
lmc_sleep(100)
lmc_send_keys ("~") -- Enter
----------------------------------------------------
elseif (button == 105) then -- Numpad 9
lmc_send_keys ('COLOR') -- Opens select color dialogue box
lmc_sleep(100)
lmc_send_keys ("~") -- Enter
----------------------------------------------------
else print('Not yet assigned: ' .. button)
end
end)
----------------------------------------------------