TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Andrea on April 11, 2005, 10:51:49 AM

Title: Open command..
Post by: Andrea on April 11, 2005, 10:51:49 AM
hi all

i have this code..

(command "_.open")


but not working..
why ? :cry:
Title: Open command..
Post by: MP on April 11, 2005, 10:57:47 AM
Because SDI = 0.
Title: Open command..
Post by: Andrea on April 11, 2005, 11:17:11 AM
Quote from: MP
Because SDI = 0.


heun !??

but don't want to change the SDI...
because i need to reset to 0 after...

how and why ??
Title: Open command..
Post by: Mark on April 11, 2005, 11:21:57 AM
search for vbastmt

moving thread ...........
Title: Open command..
Post by: Andrea on April 11, 2005, 02:39:28 PM
Quote from: Mark Thomas
search for vbastmt

moving thread ...........


Thanks Mark,..
(moving the post here)    :lol:

but do i realy need to load VBA module just for the OPEN command ?

aloso,...i'm not very familar with the "vbastmt" function...
and i can't find any help in AutoCAD... :(

can any one give me a hint or some samples or any link to lurn about this function ??

thanks.
Title: Open command..
Post by: Andrea on April 11, 2005, 02:44:58 PM
ok....

for now i have found this..

To open a drawing :

(command "vbastmt" (strcat "AcadApplication.Documents.Open "
(chr 34) filen (chr 34)))
;where filen is a qualified path and filename


but if i make  (setq filen (getfiled...blah blah blah..))
the open dialog box is not the same ...


 :evil:
Title: Open command..
Post by: SMadsen on April 11, 2005, 02:54:50 PM
Try something along the line of
Code: [Select]
(defun openMe (/ fn)
  (if (setq fn (getfiled "Open drawing" "" "dwg" 8))
    (command "VBASTMT"
             (strcat "AutoCAD.Application.Documents.Open(\"" fn "\")")
    )
  )
)
Title: Open command..
Post by: Andrea on April 11, 2005, 03:25:35 PM
Quote from: SMadsen
Try something along the line of
Code: [Select]
(defun openMe (/ fn)
  (if (setq fn (getfiled "Open drawing" "" "dwg" 8))
    (command "VBASTMT"
             (strcat "AutoCAD.Application.Documents.Open(\"" fn "\")")
    )
  )
)


heun !!??
Title: Open command..
Post by: Andrea on April 14, 2005, 10:49:26 AM
Sorry all..

But I can't find a way to obtain the same dialog box when opening a drawing... :cry:

i'm lost... :roll:
Title: Open command..
Post by: SMadsen on April 14, 2005, 10:53:06 AM
Same dialog box as what?
Title: Open command..
Post by: daron on April 14, 2005, 11:33:13 AM
The standard one that opens normally, when you type open, with all the bells and whistles.