Jump to content

Recommended Posts

Posted

How would I filter my list so that only pc3 files and "none" show

ie without listing system printers?

thanks

 

 

 
(setq ad (vla-get-activedocument (vlax-get-acad-object)))
     (vla-RefreshPlotDeviceInfo (vla-get-activelayout ad))
     (setq Devicelist (vlax-safearray->list (vlax-variant-value 
     (vla-getplotdevicenames (vla-item (vla-get-layouts ad) Model")))))

Posted

Just a simple vl-remove-if-not...

 

(defun GetPC3 ( / doc )
 (vl-load-com)

 (vla-RefreshPlotDeviceInfo
   (vla-get-ActiveLayout
     (setq doc
       (vla-get-activedocument
         (vlax-get-acad-object)
       )
     )
   )
 )
 (vl-remove-if-not
   (function
     (lambda ( x ) (or (eq "None" x) (wcmatch x "*.pc3")))
   )
   (vlax-invoke
     (vla-item (vla-get-layouts doc) "Model") 'GetPlotDeviceNames
   )
 )
)

Posted

Here it is in the options:

 

u:\chuck\lisp\other\cadtutor\plot-option.jpg

 

 

I am not sure of what the System Variable is for use in a routine.

 

Chuck

plot-option.JPG

Posted

thanks Lee - Sweet .....thats what I was after.

"vl-remove-if-not" will be useful for other things I will use later

cheers

SF :thumbsup:

 

Chuck - I was aware of that - I just needed to know programmatically

Posted
thanks Lee - Sweet .....thats what I was after.

"vl-remove-if-not" will be useful for other things I will use later

cheers

SF :thumbsup:

 

Chuck - I was aware of that - I just needed to know programmatically

Also keep in mind the useful vl-remove and vl-remove-if. :wink:

Posted

Also keep in mind the useful vl-remove and vl-remove-if.

 

Thanks for the heads up Alan

Posted

Small Fish, the 'auto word complete' in the VLIDE is quite handy for discovering similar functions if you are new to LISP - for example, in a new file in the VLIDE,

 

Type vlax-curve- then press Ctrl+Shift+Space :wink:

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