Jump to content

Is it possible to read DCL keys via AutoLISP?


Recommended Posts

Posted (edited)

I am building a program to wrap a bunch of useful functions.  I was the user to select from an arbitrarily long list, and sort this selection into one of a set amount of "baskets".  

 

Each basket contains the relevant autolisp program and DCL UI for the selected item to execute.  For example, pretend I was talking about screws.  I could select a screw, then it will open the relevant window for the type of threading and let me input the specific variables.  

 

I want a generic open window function to open the specified DCL window.  This function would, ideally, read the DCL for the open window and assign actions to each tile automatically.  

 

The example here is a toggle function, that enables/disables a window selection.  If I could read the keys from the DCL into the AutoLISP, I could automatically add all tiles to this function and have them start disabled:

 

(defun toggle(state)
  (if (eq state "1")
    (progn
      (mode_tile "length2" 0)
      (mode_tile "incline2" 0)
    )
    (progn
      (mode_tile "length2" 1)
      (mode_tile "incline2" 1)
    )
  )
)

 

Instead of manually adding each (mode_tile), I would like to have this be done automatically (likely through a mapcar lambda of a list of keys).  Is there a way to get that list?  Off the top of my head, you could read the DCL file as a txt file and search it manually, but that seems excessive.  

 

Thank you!

Edited by TemporaryCAD
Posted (edited)

Ok pick screw, then type, then dia, then length. Inside DCL you can have a child dcl so it pops up over the original dcl so as I hinted 4 sub dcl's inside main DCL. Just check help DCL CHILD.

 

Height is selected and a child dcl pops.

 

image.png.bd577f5782b22dc2806e7c5d31fc1db0.png

 

Did you google I know this has been answered before using lists.

 

Edited by BIGAL

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...