Author Topic: Plottabs help  (Read 10590 times)

0 Members and 1 Guest are viewing this topic.

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Plottabs help
« Reply #45 on: January 24, 2007, 11:19:31 AM »
Yes, that was my thought too & perhaps a DCL picklist to display the selected files with a delete button to remove any unwanted files.
Too busy at the moment though.
If I have some time then, maybe I can roll one out.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Plottabs help
« Reply #46 on: January 24, 2007, 12:15:35 PM »
Here is a quick one.  I have work to do, so I don't know if I will be able to play later.  Its real simple.  It will return a list of all the drawings selected.  It won't check to see if the drawing is already there, and no way to remove any.  Attached is my dialog boxes that one of the functions use.  Here is how to use it
Code: [Select]
(setq listDwg (SelectMultiple))
Code: [Select]
(defun SelectMultiple (/ DirPath listDwg DiaRtn listFinal)

(while (setq DirPath (Directory-dia ""))
 (if
  (and
   (setq listDwg (vl-directory-files DirPath "*.dwg" 1))
   (setq DiaRtn (MultiSelect listDwg "Select all." T))
  )
  (if (equal (car DiaRtn) T)
   (foreach dwg listDwg
    (setq listFinal (cons (strcat DirPath dwg) listFinal))
   )
   (foreach num DiaRtn
    (setq listFinal (cons (strcat DirPath (nth num listDwg)) listFinal))
   )
  )
 )
)
listFinal
)
;---------------------------------------------------------------------------------------------------
(defun Directory-Dia ( Message / sh folder folderobject result)
;; By Tony Tanzillo
;; Modified by Tim Willey
;; 16 Will let you type in the path
;; 64 Will let you create a new folder

  (vl-load-com)
  (setq sh
     (vla-getInterfaceObject
        (vlax-get-acad-object)
        "Shell.Application"
     )
  )


  (setq folder
     (vlax-invoke-method
         sh
         'BrowseForFolder
         (vla-get-HWND (vlax-get-Acad-Object))
         Message
         0 ; This is the bit number to change.
      )
  )
  (vlax-release-object sh)


  (if folder
     (progn
        (setq folderobject
           (vlax-get-property folder 'Self)
        )
        (setq result
           (vlax-get-property FolderObject 'Path)
        )
        (vlax-release-object folder)
        (vlax-release-object FolderObject)
        (if (/= (substr result (strlen result)) "\\")
          (setq result (strcat result "\\"))
          result
        )
     )
  )
)
;--------------------------------------------------------------------
(defun MultiSelect (Listof Message Toggle / DiaLoad tmpStr tmpTog tmpList)

(setq DiaLoad (load_dialog "MyDialogs.dcl"))
(if (new_dialog "MultiSelect" DiaLOad)
 (progn
  (start_list "listbox" 3)
  (mapcar 'add_list Listof)
  (end_list)
  (if Message
   (set_tile "text1" Message)
  )
  (if (not Toggle)
   (mode_tile "toggle1" 1)
  )
  (mode_tile "listbox" 2)
  (action_tile "accept"
   "(progn
    (setq tmpStr (get_tile \"listbox\"))
    (if Toggle
     (setq tmpTog (get_tile \"toggle1\"))
    )
    (done_dialog 1)
   )"
  )
  (action_tile "cancel" "(done_dialog 0)")
  (if (= (start_dialog) 1)
   (progn
    (if tmpStr
     (setq tmpList (read (strcat "(" tmpStr ")")))
    )
    (if (= tmpTog "1")
     (cons T tmpList)
     tmpList
    )
   )
  )
 )
)
)
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Plottabs help
« Reply #47 on: January 24, 2007, 12:17:27 PM »
Only if you have some spare time. Dan is in need at the moment but only if I can get this Script problem licked.
I would like to have a multi-file pick routine. It would be a neat tool. :-)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Plottabs help
« Reply #48 on: January 24, 2007, 12:19:56 PM »
That was quick. 8-)

I am having trouble with this in ACAD2000
Code: [Select]
(vla-get-HWND (vlax-get-Acad-Object))
No time here, I'll play with it this evening.
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Plottabs help
« Reply #49 on: January 24, 2007, 12:23:31 PM »
That was quick. 8-)

I am having trouble with this in ACAD2000
Code: [Select]
(vla-get-HWND (vlax-get-Acad-Object))
No time here, I'll play with it this evening.
I think someone else had problems with it.  You can remove it.  What it does is if you have two monitor it will bring up the select directory box in the middle of the acad window.  Mine used to be in the middle of my two monitors, so that is why I added it.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

ELOQUINTET

  • Guest
Re: Plottabs help
« Reply #50 on: January 24, 2007, 12:24:57 PM »
sorry guys i haven't been in here giving my input. i've been trying to complete a job this morning. cab it basically completes the first batch and says how many it is plotting and that's it there's no clues in the command box so i didn't post it. i will be busy this afternoon too so won't be able to test it much today. this is not a big rush by the way it would just be nice to have in the long run. yes i could see where a multi file selector could be used in alot of other routines. thanks guys for all your help i really appreciate it.

ELOQUINTET

  • Guest
Re: Plottabs help
« Reply #51 on: January 24, 2007, 12:33:55 PM »
i have another vba routine which will update an attribute in selected drawings and it uses the windows open dialogue box. i'm wondering if maybe you could call this vba routine a select the files you want to plot. i will look for it if this sounds like an option. i will be out of the office until 4 and will come back to check in on you guys.

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Plottabs help
« Reply #52 on: January 24, 2007, 12:54:33 PM »
That was quick. 8-)

I am having trouble with this in ACAD2000
Code: [Select]
(vla-get-HWND (vlax-get-Acad-Object))
No time here, I'll play with it this evening.
Instead of removing the line all together, just change it to 0.  It should work then.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

ELOQUINTET

  • Guest
Re: Plottabs help
« Reply #53 on: January 24, 2007, 05:27:51 PM »
what i was getting at earlier was couldn't you call this routine and use the windows dialog box to select whatever files you want. the multiple folder selection would be a nice bonus but for me it's not required.

http://www.theswamp.org/lilly_pond/index.php?dir=dan/&file=CommonDialog.dvb