Data SolidWorks two times development -04-modify data
The last time you have access to the parameters of the feature, today we will modify it:
To modify the previous steps is not less, when we can read some of the features, we can give him a set of values. Of course, sometimes you need to invoke a specific parameter. SolidWorks is OLE and COM, so get used to it.
You need to call function modifydefinition () to implement changes after you have finished modifying the feature.
We give an example, this example is more comprehensive than the previous, it has a good fault-tolerant guidance mechanism, can be directly to become a stable macro program.
This is the example doubles the length of the base extrude. This example adds an extension to the convex table by one fold.
}}-->}}-->swapp.sendmsgtouser2 "Please select the Base-extrude", Swmbwarning, Swmbok
}}-->}}-->exit Sub
}}-->}}-->end If
}}-->}}--> ' Check the feature ' s type name
}}-->}}--> ' Make sure it's an extrusion
}}-->}}-->if Not curfeature.gettypename = swtnextrusion Then
' Here to use swtnextrusion my environment did not pass, I changed to extrusion just OK
}}-->}}-->swapp.sendmsgtouser2 "Please select the Base-extrude", Swmbwarning, Swmbok
}}-->}}-->exit Sub
}}-->}}-->end If
}}-->}}--> ' Get the extrusion ' s Feature Data
}}-->}}-->set featdata = curfeature.getdefinition
}}-->
}}-->
}}-->}}--> ' Get the access selections for the feature data
}}-->}}--> ' Note this Component is NULL when accessing the selections of a standalone part. }}-->}}-->if We were calling Accessselections from within a assembly, then model would refer to the top-level docu ment in the assembly and component would refer to the actual part.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.