通过VS2019使用C#对NX12.0进行模型尺寸的更改,但是模型尺寸不会自动更新
通过VS2019使用C#对NX12.0进行模型尺寸的更改,但是模型尺寸不会自动更新本帖最后由 zwaiwo* 于 2025-10-22 09:28 编辑
我试了一下没什么问题啊 ,大概率是你没有EDIT表达式的值,你可以加一个弹窗警告可以知道哪里有问题
Public Shared Sub Main()
'在这里开始写程序
Try
Dim filePath = "C:\Users\Administrator\Desktop\新建文件夹\盖子.prt"
Dim PartLoad As PartLoadStatus = Nothing
Dim part = theSession.Parts.OpenActiveDisplay(filePath, DisplayPartOption.AllowAdditional, PartLoad)
'Dim part = theSession.Parts.Work
Dim L As Double = 110
Dim expression As Expression = CType(part.Expressions.FindObject("L"), Expression)
part.Expressions.Edit(expression, L)
theSession.UpdateManager.DoUpdate(0)
Catch ex As Exception
theui.NXMessageBox.Show("错误", NXMessageBox.DialogType.Error, ex.Message)
End Try
End Sub 你是想用winform窗口的按钮去修改nx的模型表达式吧,况且你这个写法本身就有错误
页:
[1]