Assigning-Actions-to-Tiles

Assigning Actions to Tiles

Assigning Actions to Tiles

A DCL definition does nothing more than define a lifeless dialog box. You connect
this lifeless dialog box to your dynamic AutoLISP code with the action_tile function, as demonstrated by the following code:

;; Assign actions (the functions to be invoked) to dialog buttons
(action_tile
  "gp_lw"
  "(setq plineStyle "Light")"
)
(action_tile
  "gp_hw"
  "(setq plineStyle "Pline")"
)
(action_tile
  "gp_actx"
  "(setq objectCreateMethod "ActiveX")"
)
(action_tile
  "gp_emake"
  "(setq objectCreateMethod "Entmake")"
)
(action_tile
  "gp_cmd"
  "(setq objectCreateMethod "Command")"
)
(action_tile "cancel" "(done_dialog) (setq UserClick nil)")
(action_tile
  "accept"
  (strcat "(progn (setq tileRad (atof (get_tile "gp_trad")))"
       "(setq tileSpace (atof (get_tile "gp_spac")))"
       "(done_dialog) (setq UserClick T))"
  )
)

Notice all the quotes around the AutoLISP code. When you write an AutoLISP action_tile function, your code is essentially telling a tile, “here, remember this string, then
pass it back to me when the user selects you.â€‌ The string (anything within double-quotation
marks) is dormant until the user selects the tile. At that time, the tile passes the
string to AutoCAD, which converts the string into functioning AutoLISP code and executes
the code.

For example, consider the following action_tile expression, which is connected to the lightweight polyline radio button:

(action_tile
   "gp_lw"
   "(setq plineStyle "Light")"
)

The code assigns the string “(setq plineStyle “Light”)” to the radio button. When a user picks the button, the string is passed back to AutoCAD
and transformed directly into the following AutoLISP expression:

(setq plineStyle "Light")

Look at one more code fragment. The following is the action_tile expression assigned to the OK button:

(action_tile
    "accept"
    (strcat "(progn (setq tileRad (atof (get_tile "gp_trad")))"
      "(setq tileSpace (atof (get_tile "gp_spac")))"
      "(done_dialog) (setq UserClick T))"
)

When a user clicks the OK button, the lengthy string assigned to the button is passed
to AutoCAD and turned into the following AutoLISP code:

(progn 
   (setq tileRad (atof (get_tile "gp_trad")))
   (setq tileSpace (atof (get_tile "gp_spac")))
   (done_dialog)
   (setq UserClick T)
)

This code does several things: It retrieves the current values from the tiles whose
key values are gp_trad (the tile radius) and gp_spac (the tile spacing value). Then atof converts the number string into a real number. The dialog is terminated with the
done_dialog function, and a value of T, or true, is assigned to the variable UserClick.

You’re done assigning actions to the buttons. The next thing to do is to put it all
in motion.

Learning AutoCad

>Assign actions (the functions to be invoked) to dialog buttons (action_tile "gp_lw" "(setq plineStyle "Light")" ) (action_tile "gp_hw" "(setq plineStyle "Pline")" ) …… Next, start customizing the tile. Tap the plus button on the main screen in Custom Quick Settings and assign the new action button a name and …… Launch the Custom Quick Settings app and tap the floating action button in … What actions did you assign to your custom Quick Settings tile?tile actions provider, and adds an action to all tiles in the launchpad when the …tiles:getAsString> tag will return empty string if you haven't defined its value in … And an empty <s:set> tag w/o value attribute will assign the top to a variable (in most cases it would be the current action instance).Tile tracker tag, download the phone app compatible with the … Once you have assigned a photo, click Activate. … and a standard "Out of Range" indicating that you should pursue other actions to find your Tile.… Step-by-Step instructions on how to add SharePoint Tiles (also known as … For example, if you assign ۱ to tile ۱, ۲ to tile ۲, tile ۱ will appear first, and … add respective icons and link to those actions you want users to perform.… note: If you assign an action the same shortcut that is used for a … menus, commands that display or hide panels, and use of the Selection, Pen, …tiled System on Chip. (SoC) architecture ….. a short explanation of the action performed in step (3) for a vertex v of degree.action. (Hire … She decides to perform the Assignment Action. … Alliance tiles that can be placed next to a row.

نظرات کاربران



درباره نویسنده



بنده سیامک دوستداری فارغ التحصیل رشته مکانیک سنگ از دانشگاه صنعتی اصفهان هستم، و در این وبسایت آموزش های مربوط به نحوه برنامه نویسی در اتوکد و هچنین آموزش تصویری دستورات اتوکد را قرار خواهم داد.

تلفن همراه: ۰۹۰۰۱۲۳۴۴۴۴

ایمیل: s.doostdari@gmail.com

ترفند های اتوکد



دسته بندی مطالب​