Message 1 of 6
Vlax.cls concerns

Not applicable
11-20-2007
03:43 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I’m interested in learning how to use the Vlax.cls functions in my programs. I have two concerns that I’m having trouble with. I’ve found that I if I don’t comment out the first 9 lines in the Vlax.cls code I get the error message “Compile error: Expected end of statement”. The VBA code seems to run fine with these lines commented out.
I’ve attached a small program with a VBA form to test the Vlax.cls functions. I get the command line error message “Execution error” when VBA ends and AutoLISP resumes. I’m fairly new to VBA and I’m hoping that someone will look into my small program and help me.
[code]
(defun c:VE1 (/ Entity Entitylist EntitySelect TextHeight TextValue)
(if (setq EntitySelect (entsel "\nSelect text to edit and change height: \n"))
(if (= (cdr (assoc 0 (entget (car EntitySelect)))) "TEXT")
(progn
(setq Entity (car EntitySelect))
(setq Entitylist (entget Entity))
(setq TextValue (cdr (assoc 1 Entitylist)))
(setq TextHeight (cdr (assoc 40 Entitylist)))
(command "vbaload" "VlaxExample1.dvb")
(command "vbarun" "thisdrawing.Main")
(command "vbaunload" "VlaxExample1.dvb")
(setq Entitylist (entmod (subst (cons 1 TextValue) (assoc 1 Entitylist) Entitylist)))
(setq Entitylist (entmod (subst (cons 40 TextHeight) (assoc 40 Entitylist) Entitylist)))
(entupd Entity)
(princ "\nObject updated.")
)
(princ (strcat "\nObject selected was " (cdr (assoc 0 (entget (car EntitySelect))))))
)
)
(princ)
)
[/code]
[code]
Option Explicit
Private Sub UserForm_Initialize()
Dim vl As New VLAX
Dim dblVal As Double
Dim strVal As String
strVal = vl.GetLispSymbol("TextValue")
dblVal = vl.GetLispSymbol("TextHeight")
txtTextValue.Text = strVal
dblTextHeight.Text = CStr(dblVal)
txtTextValue.SetFocus
End Sub
Private Sub cmdOK_Click()
Dim vl As New VLAX
vl.SetLispSymbol "TextValue", txtTextValue.Text
vl.SetLispSymbol "TextHeight", CDbl(dblTextHeight.Text)
End
End Sub
Private Sub cmdCancel_Click()
End
End Sub
[/code]
The 9 lines I commented out in Vlax.cls
[code]
'VERSION 1.0 CLASS
'BEGIN
' MultiUse = -1 'True
'End
'Attribute VB_Name = "VLAX"
'Attribute VB_GlobalNameSpace = False
'Attribute VB_Creatable = False
'Attribute VB_PredeclaredId = False
'Attribute VB_Exposed = False
[/code]
I’ve attached a small program with a VBA form to test the Vlax.cls functions. I get the command line error message “Execution error” when VBA ends and AutoLISP resumes. I’m fairly new to VBA and I’m hoping that someone will look into my small program and help me.
[code]
(defun c:VE1 (/ Entity Entitylist EntitySelect TextHeight TextValue)
(if (setq EntitySelect (entsel "\nSelect text to edit and change height: \n"))
(if (= (cdr (assoc 0 (entget (car EntitySelect)))) "TEXT")
(progn
(setq Entity (car EntitySelect))
(setq Entitylist (entget Entity))
(setq TextValue (cdr (assoc 1 Entitylist)))
(setq TextHeight (cdr (assoc 40 Entitylist)))
(command "vbaload" "VlaxExample1.dvb")
(command "vbarun" "thisdrawing.Main")
(command "vbaunload" "VlaxExample1.dvb")
(setq Entitylist (entmod (subst (cons 1 TextValue) (assoc 1 Entitylist) Entitylist)))
(setq Entitylist (entmod (subst (cons 40 TextHeight) (assoc 40 Entitylist) Entitylist)))
(entupd Entity)
(princ "\nObject updated.")
)
(princ (strcat "\nObject selected was " (cdr (assoc 0 (entget (car EntitySelect))))))
)
)
(princ)
)
[/code]
[code]
Option Explicit
Private Sub UserForm_Initialize()
Dim vl As New VLAX
Dim dblVal As Double
Dim strVal As String
strVal = vl.GetLispSymbol("TextValue")
dblVal = vl.GetLispSymbol("TextHeight")
txtTextValue.Text = strVal
dblTextHeight.Text = CStr(dblVal)
txtTextValue.SetFocus
End Sub
Private Sub cmdOK_Click()
Dim vl As New VLAX
vl.SetLispSymbol "TextValue", txtTextValue.Text
vl.SetLispSymbol "TextHeight", CDbl(dblTextHeight.Text)
End
End Sub
Private Sub cmdCancel_Click()
End
End Sub
[/code]
The 9 lines I commented out in Vlax.cls
[code]
'VERSION 1.0 CLASS
'BEGIN
' MultiUse = -1 'True
'End
'Attribute VB_Name = "VLAX"
'Attribute VB_GlobalNameSpace = False
'Attribute VB_Creatable = False
'Attribute VB_PredeclaredId = False
'Attribute VB_Exposed = False
[/code]