![]() |
求助:SolidWork Remove Body Material Property 的API
通过SolidWork手动操作可以
Remove Model Color Remove Body Color Remove Face Color Remove Feature Color Remove Component Color 相应的API为: ModelDoc2::RemoveMaterialProperty2 Body2没有此方法!!!!!!!!!!!! Face2::RemoveMaterialProperty2 Feature::RemoveMaterialProperty2 Component2::RemoveMaterialProperty2 请各位帮忙看看能不能把Body的Color Remove掉。 谢谢!! |
回复: 求助:SolidWork Remove Body Material Property 的API
Body2::RemoveMaterialProperty2 你这不是写了么?
|
回复: 求助:SolidWork Remove Body Material Property 的API
致vogy!!
我太粗心了,写错了,Body2没有这方法。上面的帖子已经改过来了。不好意思啦! 您帮忙看看。谢了 SolidWorks 要是所有的操作都能录宏就好了! |
回复: 求助:SolidWork Remove Body Material Property 的API
Sw的操作可以录宏啊!
Dim swApp As Object Dim Part As Object Dim SelMgr As Object Dim boolstatus As Boolean Dim longstatus As Long, longwarnings As Long Dim Feature As Object Sub main() Set swApp = Application.SldWorks Set Part = swApp.ActiveDoc Set SelMgr = Part.SelectionManager boolstatus = Part.Extension.SelectByID2("Extrude1", "BODYFEATURE", 0, 0, 0, False, 0, Nothing, 0) Part.SelectedFaceProperties 0, 0, 0, 0, 0, 0, 0, 0, "Extrude1" boolstatus = Part.EditRebuild3 Part.ClearSelection2 True End Sub |
回复: 求助:SolidWork Remove Body Material Property 的API
我说的是把删除Body颜色的操作录宏,下面是我录的宏代码,录不到删除Body颜色的API。多次麻烦您,实在是很感谢!!
Dim swApp As Object Dim Part As Object Dim SelMgr As Object Dim boolstatus As Boolean Dim longstatus As Long, longwarnings As Long Dim Feature As Object Sub main() Set swApp = Application.SldWorks Set Part = swApp.ActiveDoc Set SelMgr = Part.SelectionManager boolstatus = Part.Extension.SelectByID2("Extrude1", "SOLIDBODY", 0, 0, 0, False, 0, Nothing, 0) boolstatus = Part.Extension.SelectByID2("", "FACE", 0.01980884773644, 0.007411491703351, 0.00590052665541, False, 0, Nothing, 0) Part.ClearSelection2 True End Sub |
回复: 求助:SolidWork Remove Body Material Property 的API
我刚才又用你的API Part.SelectedFaceProperties 0, 0, 0, 0, 0, 0, 0, 0, "Extrude1" 设了一下面的颜色,我想要的效果是删除掉面的颜色,比如执行前Face是红色,Body是蓝色。在SolidWorks中我们看到的是红色。当删除Face颜色后,应该变成Bidy的蓝色。这是我所需要的,而 Part.SelectedFaceProperties 0, 0, 0, 0, 0, 0, 0, 0, "Extrude1"调用完面是黑的。还有就是我想要的是删除Body的颜色,删除面的API我找到了。
> Part.SelectedFaceProperties 0, 0, 0, 0, 0, 0, 0, 0, "Extrude1" 这一句是remove color of body,不是删除掉了面的颜色!你查看一下你的part设置的原始颜色是什么?你若执行完这一句后,应该看到的是Part的原始颜色。 >面、特征、body的颜色设置参数定义都不一样,细心观察以下几句—— '设置面的颜色,macro record,连续更改面的颜色(至少执行两次更改面的颜色的操作),可能录到正确的更改面的颜色的操作。 Part.SelectedFaceProperties 16711680, 1, 1, 0.95, 0.55, 0, 0.08, 0, "" boolstatus = Part.Extension.SelectByID2("", "FACE", -0.01716022336359, 0.02843205540347, 0.009999999999991, False, 0, Nothing, 0) 'remove面的颜色 Part.SelectedFaceProperties 0, 0, 0, 0, 0, 0, 0, 1, "" ——建议通过API help doc仔细分析每个参数的含义 |
回复: 求助:SolidWork Remove Body Material Property 的API
For 3D model(不包括草图),颜色的优先级
Component < Part < Body < feature < face 1)关掉 RealView Graphics (不选中状态) 2)在删掉面的颜色,重建model 3)检查删除面的颜色操作之后,你是否修改了对应特征的颜色。 4)建议不对body和face进行修改颜色的操作,只对特征或model进行修改颜色的操作。 5)检查你的model有几个body? 6)确认没有设置材质 |
回复: 求助:SolidWork Remove Body Material Property 的API
SW 给我的关于 macro can not record color of sketch的回复:
The behavior you describe is a current limitation of SolidWorks 2008 Functionality. We have recorded this as an enhancement in our enhancements database. This issue has also been identified as a problem that currently exists in SolidWorks 2007 or an earlier version. |
所有的时间均为北京时间。 现在的时间是 10:49 AM. |