Author Topic: Dialogbox  (Read 1943 times)

0 Members and 1 Guest are viewing this topic.

cadman6735

  • Guest
Dialogbox
« on: December 14, 2015, 10:57:17 AM »
Is there a way to skip one dialog box and not the second?

I want to use the Layout command where the first dialog box asks for the template, I will force the template path and not display the dialog box, but the next dialog box for Insert Layout, I want to display for user selection.

(command "layout" "template" "C\\path\\...\\template.dwt"  dialog for user selection insert layout)

thanks


ronjonp

  • Needs a day job
  • Posts: 7533
Re: Dialogbox
« Reply #1 on: December 14, 2015, 11:12:54 AM »
Set FILEDIA to 0

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

cadman6735

  • Guest
Re: Dialogbox
« Reply #2 on: December 14, 2015, 11:34:05 AM »
Hi RonJon

filedia 0 turns off all dialog boxes, but I tried it, still no second dialog pop up - I want to see the second dialog box but skip the first because I direct pathed to the template and want to choose from the layout selection.

Is there a way to use (initdia) to skip over one dialog box but no the next?

Thanks

cmwade77

  • Swamp Rat
  • Posts: 1449
Re: Dialogbox
« Reply #3 on: December 14, 2015, 04:40:28 PM »
The ~ is supposed to invoke the dialog box, so shouldn't something like this work:
Code: [Select]
(command "layout" "template" "drawing1.dwg" "~")

cadman6735

  • Guest
Re: Dialogbox
« Reply #4 on: December 17, 2015, 10:35:48 AM »
"~" seemed to work the same as "*"

This is what I put together from a collection of lisp I have gathered over time from helpful individuals from this and other sites.  It's crude, I'm sure, but does what I need.


Code: [Select]
(defun c:test (/ acDoc acLay x)  (vl-load-com)

  (setq tmode (getvar "tilemode"))

  (if (not (eq (getvar "tilemode") 0))
    (setvar "tilemode" 0)
  )
 

;=====================================================================================================
; Delete Current Page Setups                              
;=====================================================================================================
 
  (setq
    acDoc  (vla-get-ActiveDocument (vlax-get-Acad-Object))
    acLay  (vla-get-Layout (vla-get-PaperSpace acDoc))
  )
 
  (vla-RefreshPlotDeviceInfo acLay)
 
  (vlax-for x (vla-get-Plotconfigurations acDoc)
    (vla-delete x)
  )
 
;=====================================================================================================
; Load Plot Page Setup from Template file                               
;=====================================================================================================
 
  (if
    (findfile "Drive:\\Path\\... \\Template.dwt")
    (progn
     
      (command "_.psetupin" "Drive:\\Path\\... \\Template.dwt" "*")
      (while (wcmatch (getvar "cmdnames") "*PSETUPIN*") (command "_y"))
    )
  )

  (command "pagesetup")
 
;=====================================================================================================
; Copy Page Setup to all Layouts                              
;=====================================================================================================

  (setq
    acLays  (vla-get-Layouts acDoc)
    acLayc  (vla-get-activelayout acDoc)
  )

  (foreach itm (vl-remove (vla-get-name acLayc) (layoutlist))
    (vla-copyfrom (vla-item acLays itm) acLayc)
  )

  (setvar "tilemode" tmode)

(princ)
)


Thanks again for responding and helping when you guys can.  This site is a treasure.
« Last Edit: December 17, 2015, 10:52:10 AM by cadman6735 »