InsertVaryInstanceIncrement and InsertVaryInstanceOverride methods expect full name of the dimension as first parameter. So it should be something like Space Increment@Sketch1@Model.SLDPRT instead of Space Increment
You may use macro recorder and select the dimension to see its full name.
According to the help, when using the spacing option simply placing the phrase "Space Increment" will suffice. I am not using the dimension option since I am changing the spacing between the instances not changing dimensions within the part.
See this below. Of course I am probably misunderstanding something completely and would appreciate any correction to my logic that got me to where I am.
Thank you for your time!!
Sorry, you were right regarding the "Space Increment" - I have missed that in the Help. I have noticed that you are in assembly and trying to insert local linear pattern. I may be wrong but it seems like the instance very option is only available for part patterns (feature or body). I do not see this option in assembly components pattern property page. So most likely this is a reason of failure - this just not supported by SolidWorks.
if this is not the case could you please record a short video from what you are trying to do from the user interface?
I was investigating and was beginning to think the same thing. Thanks for validating.
I have marked your answer and correct. I am still working through my new functionality and if I run into anything else I will let you know.
Many thanks for your time!
After several weeks of work off and on, I have reworked the code so that I am patterning a hole within a part instead of an assembly pattern. However I am still having a problem with the InsertVaryInstanceOverride option.
Without this the pattern works no problem. I would like to force the values of each pattern instance instead of a continuous value.
Also, the InsertVaryInstanceIncrement works! Unfortunately all this does it increases each distance for each instance by the given value so I must have the Override option operational to do what I want.
Code thus far. I commented out the Increment option in the code, but it does work when uncommented.
Dim Part As ModelDoc2
Dim assy_name As String = Nothing
Dim feat_type As String = Nothing
Dim boolstatus As Boolean
Dim swFeature As IFeature
Dim the_hole As IEntity = orig_hole
Dim edge1 As Entity = l_edge
Dim i As Integer = 0
Dim k As Integer = 0
Dim swFeatureManager As FeatureManager
Part = swApp.ActiveDoc
boolstatus = Part.Extension.SelectByID2(select_string, "COMPONENT", 0, 0, 0, False, 0, Nothing, 0)
boolstatus = edge1.Select2(False, 1)
swFeatureManager = Part.FeatureManager
assy_name = orig_hole.Name & "@" & select_string
boolstatus = Part.Extension.SelectByID2(assy_name, "BODYFEATURE", 0, 0, 0, True, 4, Nothing, 0)
'boolstatus = swFeatureManager.InsertVaryInstanceIncrement("Space Increment", 2, 2, 0, 0.08)
boolstatus = swFeatureManager.InsertVaryInstanceOverride("Space Increment", 2, 2, 0, 1, 1, 0.06)
swFeature = swFeatureManager.FeatureLinearPattern3(6, 0.02, 1, 0, True, False, "NULL", "NULL", False, True)
Catch ex As Exception
Your time is most appreciated.
Additionally, when running the code step by step I get the following error on the Override step:
InsertVaryInstanceOverride 'InsertVaryInstanceOverride' is not declared. It may be inaccessible due to its protection level.
And the boostatus variable turns False.