I must be having a programming block, because I cannot for the life of me figure this out, and I know it's a simple solution.
I have code that updates a zone table block with attributes.
When the macro is run, if there are no polylines on certain layers or those polylines have areas that round down to 0 square feet, the macro updates the attributes with nothing.
My boss would like to see a 0. Here is the code I have:
If TypeOf oEnt Is AcadLWPolyline Then
If oEnt.Layer = USFLay Then
dblUSF = dblUSF + oEnt.Area / 144
Else
If oEnt.Layer = UNSFLay Then
dblUNSF = dblUNSF + oEnt.Area / 144
End If
End If
End If
I'm not exactly sure what variable is returning what but how 'bout something like this
If TypeOf oEnt Is AcadLWPolyline Then
If oEnt.Layer = USFLay Then
dblUSF = dblUSF + oEnt.Area / 144
if dblusf < 1 then
dblusf = 0
end if
Else
If oEnt.Layer = UNSFLay Then
dblUNSF = dblUNSF + oEnt.Area / 144
if dblunsf < 1 then
dblunsf = 0
end if
End If
End If
End If
Doglips, you've helped me yet again.
It wasn't your solution exactly that worked, but it helped me figure out that I needed to add if-then-elses to my string formatting that comes after the snippet I posted.
Thanks again.
Can't find what you're looking for? Ask the community or share your knowledge.