标题:如何实现通过窗体来修改双引号内的表达式的参数?
只看楼主
淡若清风①
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2018-4-17
结帖率:0
已结贴  问题点数:20 回复次数:1 
如何实现通过窗体来修改双引号内的表达式的参数?

a = TextBox1.Text
b = TextBox2.Text
c = TextBox3.Text
d = TextBox4.Text
e = TextBox5.Text
k = a * Sin(X / b) + c
Set swApp = _
Application.SldWorks

Set Part = swApp.ActiveDoc
boolstatus = Part.Extension.SelectByID2("草图1", "SKETCH", 0, 0, 0, False, 0, Nothing, 0)
Part.EditSketch
Part.ClearSelection2 True
boolstatus = Part.Extension.SelectByID2("Spline2", "SKETCHSEGMENT", 1.88304242471792E-02, 8.09688949697063E-03, -0.012484411658199, False, 0, Nothing, 0)
Dim equationCurve As Object
boolstatus = Part.Extension.SelectByID2("Spline2", "SKETCHSEGMENT", 1.88304242471792E-02, 8.09688949697063E-03, -0.012484411658199, False, 0, Nothing, 0)
Set equationCurve = Part.SelectionManager.GetSelectedObject5(1)
   boolstatus = equationCurve.SetEquationParameters2("", k, "", d, e, False, 0, 0, 0, True, True)
Part.ClearSelection2 True
Part.SketchManager.InsertSketch True
搜索更多相关主题的帖子: 窗体 Text Set False Nothing 
2018-04-17 19:16
wmf2014
Rank: 19Rank: 19Rank: 19Rank: 19Rank: 19Rank: 19
等 级:贵宾
威 望:216
帖 子:2039
专家分:11273
注 册:2014-12-6
得分:20 
dim k as string
k=a & "*Sin(" & x & "/" & b & ")+" & c

'没看见对x的赋值

能编个毛线衣吗?
2018-04-18 09:56



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-486147-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.215480 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved