sorry, I'm mistaken. didn't see the next line there. But I'm not seeing where you give txtHoogte a value. if txtHoogte is a text box, take out the Dim line for txtHoogte (you don't have to declare existing text boxes) and for VBA, you'll have to use txtHoogte.Caption I believe.
However, if you're trying to use txtHoogte as a variable, you'll have to assign it a value before you use it. Something like txtHoogte = tboxHoogte.Caption.
So if that's a text box, here's your new code:
Dim objBlok1 As AcadBlockReference
Dim strPath As String
Dim oprops As Variant
Dim oDblkProp As AcadDynamicBlockReferenceProperty
Dim i As Integer
dblInvoegpunt(0) = 0: dblInvoegpunt(1) = 0: dblInvoegpunt(2) = 0
Set objBlok1 = ThisDrawing.ModelSpace.InsertBlock(dblInvoegpunt, "C:\Autocad\Definitieve blocks\1.Onderkast\1.Vooraanzichten\Niet Beplakt\Vooraanzicht.NB.Doorlopende Stijlen.dwg", 1#, 1#, 1#, 0#)
If objBlok1.IsDynamicBlock Then
oprops = objBlok1.GetDynamicBlockProperties
For i = 0 To UBound(oprops)
Set oDblkProp = oprops(i)
If oDblkProp.PropertyName = "Hoogte" Then
oDblkProp.Value = txtHoogte.Caption
Exit For
End If
Next
End If
__________________________________________________________________________
__________________________________________________________________________
and if txtHoogte is supposed to be a variable, this is your new code (note: you will have to have a text box called "TBoxHoogte" on your form):
Public txtHoogte as double
'----------------------------------------------------------------------------
Dim objBlok1 As AcadBlockReference
Dim strPath As String
Dim oprops As Variant
Dim oDblkProp As AcadDynamicBlockReferenceProperty
Dim i As Integer
txtHoogte = TBoxHoogte.Caption
dblInvoegpunt(0) = 0: dblInvoegpunt(1) = 0: dblInvoegpunt(2) = 0
Set objBlok1 = ThisDrawing.ModelSpace.InsertBlock(dblInvoegpunt, "C:\Autocad\Definitieve blocks\1.Onderkast\1.Vooraanzichten\Niet Beplakt\Vooraanzicht.NB.Doorlopende Stijlen.dwg", 1#, 1#, 1#, 0#)
If objBlok1.IsDynamicBlock Then
oprops = objBlok1.GetDynamicBlockProperties
For i = 0 To UBound(oprops)
Set oDblkProp = oprops(i)
If oDblkProp.PropertyName = "Hoogte" Then
oDblkProp.Value = txtHoogte
Exit For
End If
Next
End If
___________________________________________________________________
I'm not sure if you're new to this or not, but make sure you run code to regenerate your drawing at the end or you may not see any changes.
Good luck.
(by the way, I think Autodesk's website may have corrected something it thought was HTML in there, I just can't tell what it changed.)