Hallo,
ich versuche von VB nach C# umzusteigen und versuche verschiedene Dinge, u.a. will ich in einer aktiven idw eine Mittellinie zwischen 2 paralelle Linien zeichnen.
Mit VB funktioniert das wunderbar, aber bei C# erhalte ich den Fehler: Typkonflikt
Wer kann mir das erklären, bzw.helfen?
Hier VB:
Sub Mittellinien()
Dim oZeich As Inventor.DrawingDocument
oZeich = oInventorApp.ActiveDocument
Dim oSheet As Inventor.Sheet
oSheet = oZeich.ActiveSheet
Dim oView As Inventor.DrawingView
oView = oSheet.DrawingViews(1)
Dim oCenterLines As Inventor.Centerlines
oCenterLines = oSheet.Centerlines
Dim oGeometryIntent1 As Inventor.GeometryIntent
Dim oGeometryIntent2 As Inventor.GeometryIntent
'Mittellinie zwischen 2 Linien
oGeometryIntent1 = oSheet.CreateGeometryIntent(oView.DrawingCurves.Item(3))
oGeometryIntent2 = oSheet.CreateGeometryIntent(oView.DrawingCurves.Item(5))
Call oCenterLines.AddBisector(oGeometryIntent1, oGeometryIntent2)
end sub
hier C#:
private void Mittellinien()
{
Inventor.DrawingDocument oZeich;
oZeich = (Inventor.DrawingDocument)oInventorApp.ActiveDocument;
Inventor.Sheet oSheet;
oSheet = oZeich.ActiveSheet;
Inventor.DrawingView oView;
oView = oSheet.DrawingViews[1];
Inventor.Centerlines oCenterLines = oSheet.Centerlines;
Inventor.GeometryIntent oGeometryIntent1;
Inventor.GeometryIntent oGeometryIntent2;
//Mittellinie zwischen 2 Linien
oCenterLines = oSheet.Centerlines;
jetzt steigt C# aus:
oGeometryIntent1 = oSheet.CreateGeometryIntent(oView.DrawingCurves[1]);
oGeometryIntent2 = oSheet.CreateGeometryIntent(oView.DrawingCurves[9]);
oCenterLines.AddBisector(oGeometryIntent1, oGeometryIntent2);
}
Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP