Community
Dynamic Blocks Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Round problem in vba

0 REPLIES 0
Reply
Message 1 of 1
Demasure1
263 Views, 0 Replies

Round problem in vba

Hello,

 

When i round the number 27.625 it changes into 0

What am i doing wrong?

 

I added a printscreen of the problem.

my code:

 

If frmKast.chkP1LL1 = True Then
Dim dblInvoegpunt(0 To 2) As Double
Dim MaatRijboring As Double
Dim Tussenstap1 As Double
Dim Tussenstap2 As Double
Dim Tussenstap3 As Variant
Dim Tussenstap4 As Double
Dim tussenstap5 As Double
Dim JuisteAfronding As Variant
Dim SpelingRijboring As Double
Dim SpelingRegelingLaatsteGat As Double

JuisteAfronding = 0.5
MaatRijboring = frmKast.txtHoogte - frmKast.txtOnder1 - frmKast.txtBoven1
Tussenstap1 = (MaatRijboring / 32)
Tussenstap2 = Tussenstap1 - JuisteAfronding
Tussenstap3 = Round(Tussenstap2)
For Tussenstap3 = 0 To 2
Tussenstap4 = ((Tussenstap3 - 1) * 32)
SpelingRijboring = (MaatRijboring - Tussenstap3) / 2

SpelingRegelingLaatsteGat = (((Tussenstap3) * 32) - (Tussenstap3 * 32)) / 2
dblInvoegpunt(0) = (0 + DikteLinks + frmInvoegpunt.txtXasVAZ): dblInvoegpunt(1) = (0 + frmKast.txtOnder1 + frmInvoegpunt.txtYasVAZ + SpelingRijboring + SpelingRegelingLaatsteGat): dblInvoegpunt(2) = (0)
Set objBlok1 = ThisDrawing.ModelSpace.AddMInsertBlock(dblInvoegpunt, "C:\Autocad\Definitieve blocks\4.Bewerkingen\2.Rijboring\Vooraanzicht Rijboring.dwg", 1, 1, 1, 0, 3, 10, 32, 1)
Call MOD_Prop_Block("RijboringDiepte", DiepteRij3)

objBlok1.Columns = 1
objBlok1.Rows = Tussenstap3

 

i hope somebody knows how to fix this.

thanks

0 REPLIES 0

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

”Boost

 

”Tips

 

”Services