Jump to content

Some Simple Autolisp Questions.


SteveK

Recommended Posts

FYI and a minor point.

(vl-load-com) is not needed for vl- functions but is required to be execuited once before any vla- vlax- or vlr- functions are used.

Link to comment
Share on other sites

  • Replies 59
  • Created
  • Last Reply

Top Posters In This Topic

  • Lee Mac

    22

  • SteveK

    20

  • CAB

    8

  • MSasu

    6

Top Posters In This Topic

FYI and a minor point.

(vl-load-com) is not needed for vl- functions but is required to be execuited once before any vla- vlax- or vlr- functions are used.

 

I did not realise that - thanks Alan :thumbsup:

Link to comment
Share on other sites

You welcome!

There is also possible to list all the entries in a specified definitions table – see below how to list all text styles defined in current drawing (may use MEMBER statement later to search if a particular style is in list):

 

(setq TStyleEntry (cdr (assoc 2 (tblnext "STYLE" 1)))
     TStylesList '())
(while TStyleEntry
(setq TStylesList (append TStylesList (list TStyleEntry))
      TStyleEntry (cdr (assoc 2 (tblnext "STYLE"))))
)

Regards

 

Another way:

 

(defun get_tbl_styles (/ tdef lst)
 (reverse
   (while (setq tdef (tblnext "STYLE" (not tdef)))
     (setq lst (cons (cdr (assoc 2 tdef)) lst)))))

Link to comment
Share on other sites

  • 3 weeks later...
How does that work Lee? ai_table isn't a function is it?

 

Yes, it is a function defined in the ai_utils.lsp in the ACAD Support folder :)

 

Try it at the command line :)

Link to comment
Share on other sites

Thats handy. And the 3 is the sum of 1 & 2:

1 = Do not list Layer 0 and Linetype CONTINUOUS.

2 = Do not list anonymous blocks or anonymous groups.

 

How do you discover these things? :)

Link to comment
Share on other sites

  • 2 weeks later...

New Question: Retrieving a List of Selected Layouts...

 

I don't really want to start a new thread for a question so small, except if no one notices this question...

Does anyone know, when you select multiple layout tabs (with Ctrl), is there a way of outputting a list of the layout names of only those selected layouts?

 

The aim is to then do specific searches on only those selected tabs.

 

Appreciate any help.

 

 

 

Aside: As per the previous post I did a search for ACAD.dcl and nothing turned up.

Link to comment
Share on other sites

To answer the aside first:

 

The ACAD.dcl is in a hidden folder :P

 

Something like this path:

 

C:\Users\<username>\AppData\Roaming\Autodesk\AutoCAD XXXX\RXX.0\enu\Support\

Link to comment
Share on other sites

Regarding the main question:

 

Lee I don't think you've ever not been able to help me, now I'm worried no answer exists!

 

Though I would have thought there would be an answer, as Publish provides the layouts based on those selected, so it must retrieve it somehow.

 

 

 

 

About the aside: Ah, there ACAD.dcl is, it was hidden. I haven't made any dialog boxes yet, but I'm sure that'll come in handy when I do.

Link to comment
Share on other sites

Thanks CAB!

 

Just so others know; if you also get an error: dos_multilist is a DOSLib function, so load DOSLib before using.

 

Bit different to what I expected but it outputs a list of layouts, so it does the job. :)

Link to comment
Share on other sites

Yeah I haven't done any C++ so Daniels solution is over my head (not that CAB's isn't, but it's shorter :)).

I'm happy with CAB's, I'll just include a (load DOSLib) in my code.

 

Lee: yes, I am learning C++, but I only started learning about 2 days ago
lol, I'm sure if only you had a week you would understand his code. how are your efforts to knock over as many languages as you can in a year going?
Link to comment
Share on other sites

Yeah I haven't done any C++ so Daniels solution is over my head (not that CAB's isn't, but it's shorter :)).

I'm happy with CAB's, I'll just include a (load DOSLib) in my code.

 

I think CAB also included another solution in the Swamp thread, that didn't include the DosLib - you may be interested in.

 

lol, I'm sure if only you had a week you would understand his code. how are your efforts to knock over as many languages as you can in a year going?

 

Well, C++ is going to be a lot tougher to crack than LISP, but I shall have to see how I get on :)

Link to comment
Share on other sites

I cannot see this other method you speak of, or at least maybe I need to have an account there to see it? Only the dos_multilist one.

Link to comment
Share on other sites

I cannot see this other method you speak of, or at least maybe I need to have an account there to see it? Only the dos_multilist one.

 

Reply #4, I think you will need an account to see the attachments :)

Link to comment
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
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...