Sendcommand problem

Sendcommand problem

Anonymous
Not applicable
223 Views
2 Replies
Message 1 of 3

Sendcommand problem

Anonymous
Not applicable
I'm using VB6 to send a vbarun command as follows:

mypath = VB.App.Path
acaddoc.SendCommand "-vbaload" & vbCr & mypath + "\myfile.dvb"
acaddoc.SendCommand "-vbarun" & vbCr & "myfile.dvb!mymacro" & vbCr

It seems that if the path contains any spaces they are interpreted as
returns in AutoCAD and the whole path isn't sent. Any way to handle this?

Thanks

Bud
0 Likes
224 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
Try acaddoc.loadDVB or acadapp.loadDVB

Bud Miller had the next bright idea:

>I'm using VB6 to send a vbarun command as follows:
>
>mypath = VB.App.Path
>acaddoc.SendCommand "-vbaload" & vbCr & mypath + "\myfile.dvb"
>acaddoc.SendCommand "-vbarun" & vbCr & "myfile.dvb!mymacro" & vbCr
>
>It seems that if the path contains any spaces they are interpreted as
>returns in AutoCAD and the whole path isn't sent. Any way to handle this?
>
>Thanks
>
>Bud
>
>

--
You ask a silly question, you get a technical answer...
0 Likes
Message 3 of 3

Anonymous
Not applicable
Or you could use a lisp call:
acaddoc.SendCommand "(vl-vbarun (strcat " & mypath & chr(34) &
"/myfile.dvb!mymacro" & chr(34) & ")(princ)" & vbCr

Watch for errors with the mypath string. If you have to change \ with / then
you can use this code:

Dim C1 as Integer
For C1 = 1 To Len(mypath)
If Mid(mypath, C1, 1) = "\" Then
mypath = Mid(mypath, 1, C1 - 1) & "/" & Mid(mypath, C1 + 1)
End If
Next C1

Hope this helps,
--
Henk

CadFancy - Adventures in Visual Basic
www.CadFancy.myweb.nl
0 Likes