Reply

problem with keypoint curves

[ Edited ]

 

Hi everyone,

I have trouble's with creating keypoint curves.

I use VB.net 2010 and I get some weird(for me) error message after several procedure.

I try many different ways, here is my last trying:

(this code assumes that SE is running with an open part doc and have a simple

extruded protrusion on a rectangular profile base)

Here is the VB.net code:

Imports System.Runtime.InteropServices

Module Module1

    Sub Main()

        Dim SEApplication As SolidEdgeFramework.Application = Nothing

        Dim partDoc As SolidEdgePart.PartDocument = Nothing

        Dim curveCollect As SolidEdgePart.KeyPointCurves = Nothing

        Dim edgeCollect As SolidEdgeGeometry.Edges = Nothing

        Dim topFace As SolidEdgeGeometry.Face = Nothing

        Dim numEdges As Integer = 2

        Dim edgeSet() As SolidEdgeGeometry.Edge = New SolidEdgeGeometry.Edge(1) {}

        Dim keyPointType() As SolidEdgeConstants.KeyPointType = New SolidEdgeConstants.KeyPointType(1) {}

        Dim keyEndCond As SolidEdgePart.KeypointEndConditionConstants = SolidEdgePart.KeypointEndConditionConstants.seKeypointEndConditionNatural

        Try

            SEApplication = Marshal.GetActiveObject("SolidEdge.Application")

            partDoc = SEApplication.ActiveDocument

            topFace = partDoc.Models.Item(1).ExtrudedProtrusions.Item(1).TopCap

            edgeCollect = topFace.Edges

            curveCollect = partDoc.Constructions.KeyPointCurves

            edgeSet(0) = edgeCollect.Item(1)

            edgeSet(1) = edgeCollect.Item(2)

            keyPointType(0) = SolidEdgeConstants.KeyPointType.igKeyPointMiddle

            keyPointType(1) = SolidEdgeConstants.KeyPointType.igKeyPointMiddle

            curveCollect.Add(numEdges, edgeSet, keyPointType, keyEndCond)

The exception code after the last line:

" Could not load file or assembly 'Interop.SolidEdgeFramework, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies... "

I got the same error even if I put "Nothing" as arguments and after KeypointCurve.GetAllPoints procedure.

I use SolidEdge ST2. Sorry for my english and thanks for your help!

 

Posted by: Kikke Nemet
Post date: 9/26/2011 12:34:32 PM

1 REPLY

Re: problem with keypoint curves

Copy Interop.*.dll to binary(.exe) folder solves the file not found problem.

But I am getting invalid argument exception afterwards.