Inventor .net Addin works in german Inventor only
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I'm facing a wierd situation... I develop an Inventor addin in a german environment. The test-version were out and I got the feedback, that the addin is not working on a Czech installation of inventor. So I downloaded a czech langpack for my Inventor and gone testing.
The addin loads fine and my commands start, but on adding a facefeature to an empty sheetmetal doc, I get an error.
I tested on english Inventor as well, same errorous result... I'm not aware I had any Globalization implemented....
Is it possible, that the interop.dll is in some way languagedependent?????
Anyhow, here a code snippett the problem occurs:
Public Shared Function CreateBaseFeature(vm As Page_Data_ViewModel) As Boolean
If HasBaseFeature Then 'it's a local property which checks the count of the compdef.features...
MsgBox("Bauteil hat bereits ein Grundblech")
Return False
End If
Dim sketch As PlanarSketch = c.Sketches.Add(c.WorkPlanes(3), False)
Dim sklines As SketchLines = sketch.SketchLines
Dim skPoints As SketchPoints = sketch.SketchPoints
Dim otg As TransientGeometry = Globals.iApp.TransientGeometry
Dim skent As SketchEntity = sketch.AddByProjectingEntity(c.WorkPoints(1))
sklines.AddAsTwoPointCenteredRectangle(skent, otg.CreatePoint2d(vm.Width / 20, vm.Height / 20))
Dim d1 As DimensionConstraint = sketch.DimensionConstraints.AddTwoPointDistance(sklines(1).StartSketchPoint,
sklines(1).EndSketchPoint,
DimensionOrientationEnum.kHorizontalDim, otg.CreatePoint2d(0, vm.Height / 20 + 5))
Dim d2 As DimensionConstraint = sketch.DimensionConstraints.AddTwoPointDistance(sklines(2).StartSketchPoint,
sklines(2).EndSketchPoint,
DimensionOrientationEnum.kVerticalDim,
otg.CreatePoint2d(vm.Width / 20 + 5, 0))
Dim p As Profile = sketch.Profiles.AddForSolid()
Dim features As SheetMetalFeatures = c.Features
Dim fd As FaceFeatureDefinition = features.FaceFeatures.CreateFaceFeatureDefinition(p)
Dim ff As FaceFeature = features.FaceFeatures.Add(fd) '<<<--- Here I get a wierd error: like Uint cannot converted to some enum.... debugging/running german Inventor is just fine
d1.Parameter.Name = "BasisBreite"
d2.Parameter.Name = "BasisHoehe"
ff.Name = "BasisBlech"
sketch.Name = "Skizze_BasisBlech"
Globals.iApp.ActiveView.GoHome()
Globals.iApp.ActiveView.GoHome()
End FunctionAny hints are highly appreciated!
Thanks,
Daniel
Inventor 2014, SP2, Update 7, VBA reinstalled in all languages (thought, it's reregistering the interop in the GAC, or some... 🙂 )