Small Fish Posted June 8, 2010 Posted June 8, 2010 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"))))) Quote
Lee Mac Posted June 8, 2010 Posted June 8, 2010 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 ) ) ) Quote
CHLUCFENG Posted June 8, 2010 Posted June 8, 2010 Here it is in the options: I am not sure of what the System Variable is for use in a routine. Chuck Quote
Small Fish Posted June 8, 2010 Author Posted June 8, 2010 thanks Lee - Sweet .....thats what I was after. "vl-remove-if-not" will be useful for other things I will use later cheers SF Chuck - I was aware of that - I just needed to know programmatically Quote
alanjt Posted June 9, 2010 Posted June 9, 2010 thanks Lee - Sweet .....thats what I was after."vl-remove-if-not" will be useful for other things I will use later cheers SF 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: Quote
Small Fish Posted June 9, 2010 Author Posted June 9, 2010 Also keep in mind the useful vl-remove and vl-remove-if. Thanks for the heads up Alan Quote
Lee Mac Posted June 9, 2010 Posted June 9, 2010 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: Quote
Recommended Posts
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.