Plotter (pdf driver) name list and CTB list

Plotter (pdf driver) name list and CTB list

Anonymous
Not applicable
1,563 Views
13 Replies
Message 1 of 14

Plotter (pdf driver) name list and CTB list

Anonymous
Not applicable

Can Any one suggest me a autolisp routine to store the plotter name list and another one for Ctb list?

 

0 Likes
1,564 Views
13 Replies
Replies (13)
Message 2 of 14

dlanorh
Advisor
Advisor

Try these.

 

(defun c:plotters (/ c_doc c_lay plotters)
  (vl-load-com)
  (setq c_doc (vla-get-activedocument (vlax-get-acad-object)))
  (setq c_lay (vla-get-activelayout c_doc))
  (vla-refreshplotdeviceinfo c_lay)
  (setq plotters (vlax-invoke c_lay 'getplotdevicenames))
  (mapcar '(lambda (x) (princ (strcat "\nPlotter : " x))) plotters)
  (princ)
)

(defun c:PlotStyles ( / c_doc p_styles)
  (setq c_doc (vla-get-activedocument (vlax-get-acad-object)))
  (vla-refreshplotdeviceinfo (vla-get-activelayout c_doc))
  (setq p_styles (vlax-invoke (vla-item (vla-get-layouts c_doc) "Model") 'getplotstyletablenames))
  (mapcar '(lambda (x) (princ (strcat "\nPlot Style : " x))) p_styles)
  (princ)
)

They print the lists to the command line, but by removing the (mapcar..) and (princ) from the end and removing the "c:" from the defun names they can be used as functions that will return lists.

I am not one of the robots you're looking for

0 Likes
Message 3 of 14

Anonymous
Not applicable

Thank you so much, its working...

Can you help me with one more thing?

I want to use this list in a popup list of a .dcl file. I have created the .dcl... but I'm not getting the proper autolisp routine to use this "plotters" list in popup list! And after unloading the .dcl I want to continue that lisp with that input (selection) of plotter name.

0 Likes
Message 4 of 14

Sea-Haven
Mentor
Mentor

You need to post your code for the pop up list else there are many examples of library pop up lists in a dcl have a look at Lee-mac.com for one example.

0 Likes
Message 5 of 14

dlanorh
Advisor
Advisor

In the lisp code that controls the dcl you need to add the items in the list to the dcl list box. You do this using this snippet

 

  (start_list "list")    ;"list" should be replaced with the key of your list box or popup list
  (mapcar 'add_list lst) ; lst should be replaced with the name of the relevant list
  (end_list)

; this needs to be included for each list box where indx is the variable to store the
; list index of the selected item. the variable name should be different for each list
(action_tile "list" "(setq indx $value)") ;this is used to return the selected item from the list
(setq item (nth indx lst))

I am not one of the robots you're looking for

0 Likes
Message 6 of 14

dlanorh
Advisor
Advisor

Attached is an example lisp that makes use of a popup list. The lisp writes its own dcl file and deletes it when finished. It is a bit convoluted but the (rh:show_dcl) defun will give you a better idea of how this all works. I hope you can follow the logic. Type "test" to start and you will get two popups asking you to select. At the end an alert shows your choices.

 

 

I am not one of the robots you're looking for

0 Likes
Message 7 of 14

Anonymous
Not applicable

Yes, That's one I was looking for.

Can you just place both popup list in a single dialog box?

The snap of the Dialog box I created is attached.

can you just modify the lisp you send as per my requirement?

0 Likes
Message 8 of 14

dlanorh
Advisor
Advisor
I will try to sort this later today, a bit busy at the moment.

I am not one of the robots you're looking for

0 Likes
Message 9 of 14

Anonymous
Not applicable

Ok sir.

when you program it kindly place a default option if nothing is selected.

And thank you so much for quick response and proper solutions.

0 Likes
Message 10 of 14

Anonymous
Not applicable

is it possible to include page size list also?

0 Likes
Message 11 of 14

Sea-Haven
Mentor
Mentor

Are you trying to make automated plotting ? Its much easier to use say  a menu with options, we had A4, A3 colour, mono, A1 colour. The program even knew by your name which floor you were on and would send an A3 colour to the correct printer.

 

How many plot set ups do you really have or is it all based around using PUBLISH ?

0 Likes
Message 12 of 14

Anonymous
Not applicable

I am working on a Lisp routine to setup layout page settings and set viewport and adjust the drawing in given scale.

I want this Dialog box if the default plotter is not available or user want to change plotter name , plot style or any other customisation.

 

  • If user choose "Settings" keyword, required dialog box will open
  • If user doesn't have default PDF driver , dialog box will automatically open
  • After filling parameters in dialog box the rest process of the lisp will continue as per inputs
  • layout name will be optional, default layout name will be page size (example: "34x44" for ANSI E)
0 Likes
Message 13 of 14

Anonymous
Not applicable

Is there any one to reply!

0 Likes
Message 14 of 14

Sea-Haven
Mentor
Mentor

Google  Maratovich plotting he has a extensive plotting routine that should do what you want its not free but in-expensive.

 

Again how many combinations in reality ?

0 Likes