几何尺寸与公差论坛

 找回密码
 注册
查看: 660|回复: 0

【转帖】run once

[复制链接]
发表于 2009-4-13 14:00:42 | 显示全部楼层 |阅读模式
run once
hi
please advise if it is possible for a macro to be run once only.the attached macro scales the part by enlargening it by 1%.the scale function is renamed to shrinkage0.1 in the tree.is it possible for the macro to check the tree first if "shrinkage0.1 is already there? if "shrinkage0.1" is in the tree then could some code be added to say that the macro has been run already by means of a msgbox.
thank you
feroz mahomed
windows xp professional sp2
sworks 2009 sp2
nvidia quadro fx1500
hi feroz,
you coud use featuremanager::isnameused to know if the feature already exist.
simone
simone,
thank you for the response. do you have an example of how i could do this? please note that i don't have any programming experience.
feroz mahomed
windows xp professional sp2
sworks 2009 sp2
nvidia quadro fx1500
hi feroz,
i don't have any example, anyway it's very simple:
- get the feature manager object by the document modeldoc2::featuremanager
- call the method featuremanager::isnameused that returns true if already exist a feature with the name searched.
i don't know your situation, anyway you can retrive the document object (modeldoc2) by many ways: from solidworks by activedoc, from a component, ecc...
simone
simone,
as stated previously, i don't have any vb programming knowledge.i usually modify example simple api files to suit my needs.
feroz mahomed
windows xp professional sp2
sworks 2009 sp2
nvidia quadro fx1500
quick
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|小黑屋|几何尺寸与公差论坛

GMT+8, 2024-12-23 00:30 , Processed in 0.034744 second(s), 19 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表