Jump to content
SteveK

Some Simple Autolisp Questions.

Recommended Posts

SteveK

Ta!

That's a good alternative.

Share this post


Link to post
Share on other sites
CAB

Glad you like it. I have never seen the TabSelected property exposed to LISP.

Share this post


Link to post
Share on other sites
Lee Mac
Glad you like it. I have never seen the TabSelected property exposed to LISP.

 

Put it on the wishlist I think :)

 

vla-get-TabSelected

Share this post


Link to post
Share on other sites
SteveK

CAB, about your layout select program. I want to run it from another lisp to get the tab list. After I run it is there a way to retrieve the tablst variable? Or is setting tablst as a global variable the only way?

Thanks.

Share this post


Link to post
Share on other sites
CAB

Steve,

Use this version & it will return the list or nil if none selected.

(defun GetTabList (/ dclfile dcl# layouts ptr tablist)
 (setq dclfile "LayoutSelect.dcl")
 (cond
   ((< (setq dcl# (load_dialog dclfile)) 0) ; Error 
    (prompt (strcat "\nCannot load " dclfile "."))
   )
   ((not (new_dialog "layoutselect" dcl#)) ; Error 
    (prompt (strcat "\nProblem with " dclfile "."))
   )
   (t ; No DCL problems: fire it up 
    (setq layouts (vl-sort (layoutlist) '<))
    (start_list "layouts")
    (foreach one layouts
      (add_list one)
    )
    (end_list)
   (action_tile "layouts" "(setq ptr $value)")
   (action_tile "ok" "(done_dialog 5)")
   (action_tile "cancel" "(done_dialog 1)")
    (setq action (start_dialog))
    (unload_dialog dcl#)
    (if (and ptr (= action 5)) ;  get the list of selections to list of numbers
      (setq ptr     (read (strcat "(" ptr ")"))
            tablist (mapcar '(lambda (x) (nth x layouts)) ptr))
    )
   ) ; end cond T
 ) ; end cond
 tablist
)

Share this post


Link to post
Share on other sites
SteveK

Thanks mate.

Share this post


Link to post
Share on other sites
CAB

You're quite welcome.

Just after midnight here so I'll say good night, guess you're just getting up. :)

Share this post


Link to post
Share on other sites
SteveK

Getting up? Lol no it's the afternoon, I'm gearing up for home time. I think it would be Lee just getting up. :D

Share this post


Link to post
Share on other sites
Lee Mac

haha, its great how "global" we all are :)

Share this post


Link to post
Share on other sites
chulse
Yes, it is a function defined in the ai_utils.lsp in the ACAD Support folder :)

 

Try it at the command line :)

 

Lee,

I couldn't find that file anywhere - any Idea?

Share this post


Link to post
Share on other sites
Lee Mac

Type this at the command line:

(findfile "ai_utils")

Share this post


Link to post
Share on other sites
chulse

it returned nil

Share this post


Link to post
Share on other sites
Lee Mac
it returned nil

 

Oh right - perhaps Civil 3D doesn't have it :unsure:

Share this post


Link to post
Share on other sites
chulse

Was it part of the standard install for your version?

Share this post


Link to post
Share on other sites
Lee Mac

Yeah, standard install with ET

Share this post


Link to post
Share on other sites
CAB

Try this:

(findfile "ai_utils.lsp")

Share this post


Link to post
Share on other sites
Lee Mac
Try this:

(findfile "ai_utils.lsp")

 

Oops... yeah, I kinda forgot the extension :oops:

Share this post


Link to post
Share on other sites
chulse

That did it! Thanks!

 

It was under

"C:\\program files\\autocad civil 3d 2010\\support\\ai_utils.lsp"

Share this post


Link to post
Share on other sites

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
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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...