Tuesday, February 07, 2012
OPEN PART AND CHANGE VARIABLES
Last Post 25 Mar 2010 03:16 PM by rafael86. 0 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
rafael86User is Offline
New Member
New Member
Posts:10

--
25 Mar 2010 03:16 PM  

Hi, I want write a program which could first open the part file and then update the variables, but now i have a problem . . . i wrote this program and i dont know what is wrong, thanks for help

 

Imports System.Runtime.InteropServices
Public Class Form1
    Dim objApplication As SolidEdgeFramework.Application = Nothing
    Dim objPart As SolidEdgePart.PartDocument = Nothing
    Dim objVariables As SolidEdgeFramework.Variables = Nothing
    Dim objVariable As SolidEdgeFramework.variable = Nothing
    Dim objDocuments As SolidEdgeFramework.Documents
    Dim objApp As SolidEdgeFramework.Application

    Dim val1 As String
    Dim strValue As String
    Dim strName As String

    Const TESTFILE = "E:\VBA\part_2.par"



    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load


    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click


        objDocuments = objApp.Documents
        Call objDocuments.Open(Filename:=TESTFILE)


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


        objPart = objApplication.ActiveDocument
        objVariables = objPart.Variables


        val1 = Val(TextBox1.Text)
        strValue = (val1 - 130) / 2
        strName = "tworz_1"



        objVariables.Edit(strName, strValue)
    End Sub

You are not authorized to post a reply.

Active Forums 4.2
Copyright © 2011 JasonNewell.NET