Message 1 of 2
VLA- newbie question

Not applicable
06-19-2002
05:29 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I tried asking this over in Customization Lisp ng. Didn't get one response. Maybe I can get someone here to help me.
Since the VLA functions are based on VBA expressions then I don't guess this would be considered too off topic.
I'm trying my hand for the first time at the VLA- functions. I'm trying to make it open up the current directory when I want to attach an xref. Kind of like Frank Whaleys opendwg function, only I want to use more of the VLA functions instead of mixing plain autolisp within it.
Here's what I've done, so far.
(defun C:XRFDR ()
(vl-load-com)
(setq xrfpic (getfiled "Select Dwg" (getvar "dwgprefix") "dwg" 16)
(if (= 0 (getvar "SDI"))
(command
"_.VBASTMT"
(strcat ("AcadApplication.Documents.open \"" xrfpic "\"")
)
(vla-sendcommand
(vla-get-ModelSpace
(vla-get-activedocument (vlax-get-acad-object))
)
(vla-AttachExternalReference (xrfpic "0,0" "" "" "" ""))
)
)
)
)
(princ)
)
TIA
Robert Davis
Since the VLA functions are based on VBA expressions then I don't guess this would be considered too off topic.
I'm trying my hand for the first time at the VLA- functions. I'm trying to make it open up the current directory when I want to attach an xref. Kind of like Frank Whaleys opendwg function, only I want to use more of the VLA functions instead of mixing plain autolisp within it.
Here's what I've done, so far.
(defun C:XRFDR ()
(vl-load-com)
(setq xrfpic (getfiled "Select Dwg" (getvar "dwgprefix") "dwg" 16)
(if (= 0 (getvar "SDI"))
(command
"_.VBASTMT"
(strcat ("AcadApplication.Documents.open \"" xrfpic "\"")
)
(vla-sendcommand
(vla-get-ModelSpace
(vla-get-activedocument (vlax-get-acad-object))
)
(vla-AttachExternalReference (xrfpic "0,0" "" "" "" ""))
)
)
)
)
(princ)
)
TIA
Robert Davis