Hi,
We are creating drawing views for an assembly using C#. It did not look quite right, so we created the same using Vb.Net and this looked right. The only differnce in these codes are for C#, the assembly document needs to be casted as _Document object while using the AddBaseView method. The trouble with C# output is that an object participating in a Combine Feature (Boolean subtract) shows up in drawing views as if it was a Boolean addition.
Attached files shows the output.
Has anyone had any experience like these? Appreciate any suggestion.
Thanks!
The API is the same regardless of which language calls it. Inventor doesn't even know what language is making the API call. However, there are small differences in the languages that can sometimes make correctly formatting a call a bit tricky. Is it possible for you to provide a simple test case that demonstrates this so we can see what you're doing in the C# call to be causing the difference in the result?
Please find the attached zip file which has got both the C# and Vb.net versions of code to generate the drawing views.
There are differences in arithmetics between C# and VB.NET:
e.g.
C# double val1 = 7; double val2 = val1 / 2; // val2 = 3.5 double val3 = 1 / 2; // val3 = 0.0 !! VB.NET Dim val1 As Double = 7 Dim val2 As Double = val1 / 2 ' val2 = 3.5 Dim val3 As Double = 1 / 2 ' val3 = 0.5 !! Dim val4 As Double = 1 \ 2 ' val4 = 0.0
You are using System.Math.Atan(1 / 2), which would be affected by the above. I might have missed other calculations in your code that might also end up with different results.
You should check all the values you're passing to Inventor functions to make sure they are the same.
Cheers,