Jump to content

Recommended Posts

Posted

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.

  • Replies 59
  • Created
  • Last Reply

Top Posters In This Topic

  • Lee Mac

    22

  • SteveK

    20

  • CAB

    8

  • MSasu

    6

Top Posters In This Topic

Posted
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:

Posted
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)))))

Posted

@Lee Mac:

Indeed, concise solution!

  • 3 weeks later...
Posted
@Lee Mac:

Indeed, concise solution!

 

Even more Concise:

 

(ai_table "BLOCK" 3)

Posted

How does that work Lee? ai_table isn't a function is it?

Posted
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 :)

Posted

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? :)

Posted

Mostly from others code, and just curiousity I suppose :)

 

The ACAD.dcl is a nice one to peruse also, some handy widgets in there. :)

  • 2 weeks later...
Posted

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.

Posted

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\

Posted

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.

Posted

(setq layout (dos_multilist "Select Layouts" "Select layouts" (layoutlist)))

. :roll:

Posted

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

Posted

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?
Posted
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 :)

Posted

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.

Posted
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 :)

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