Code Red > VB(A)

using vba routine transparent

(1/2) > >>

jura:
I've got this small vba routine for setting osnap values:


--- Code: ---
Sub SnapToggle(VarSnapType As Integer)
Dim VarOsmode As Integer
Dim VarAftrek As Integer
Dim VarOsmodeOrg As Integer

VarOsmode = ThisDrawing.GetVariable("osmode")
VarOsmodeOrg = ThisDrawing.GetVariable("osmode")
VarAftrek = 16384

While VarAftrek > VarSnapTyp
VarAftrek = VarAftrek / 2
If VarOsmode > VarAftrek Then VarOsmode = VarOsmode - VarAftrek
Wend

If VarOsmode = VarSnapType Then VarOsmodeOrg = VarOsmodeOrg - VarSnapType
If VarOsmode < VarSnapType Then VarOsmodeOrg = VarOsmodeOrg + VarSnapType

ThisDrawing.SetVariable ("osmode"), VarOsmodeOrg
End Sub

--- End code ---



The routine is called with:

--- Code: ---
^C^C(command "VBASTMT" "SnapToggle(256)");

--- End code ---



Is it possible to use this routine transparent???

daron:

--- Quote from: jura ---
The routine is called with:

--- Code: ---
^C^C(command "VBASTMT" "SnapToggle(256)");

--- End code ---



Is it possible to use this routine transparent???
--- End quote ---


Not with how you're calling it. You can't do anything transparent when you have command in the code. Try vbaload and vbarun.

jura:
Could you specify that a little futher Daron?

The routine is loaded on start up so that's no problem. But it won't work with vbarun, cause i need to transfer a variable from the command line to vba. (i use the same routine with different variables) If there is an other sollution please let me know.

daron:
I'm going to have to defer to Keith or Trev on that one. I too am still trying to wrap my head around vba. Every time I get started, I have to stop and by the time I get started again, I can't remember how to start.

jura:
same here Daron!!!


Jura calling Keith or Trev!!! come in plz.....  :wink: (or any other mastermind)

Navigation

[0] Message Index

[#] Next page

Go to full version