Hello,
I want to create non-associative patterns using VBA, I tried to use CreateHatchPattern1 method but it gave me only associative pattern.
So, It is possible to create an non-associative pattern with VBA ?
Mannel said:It is possible to create an non-associative pattern with VBA ?
Post your code!
Regards, Jon Summers LA Solutions
Here is my code :
Sub pattern() Dim niveau As Level Dim critere As New ElementScanCriteria Dim elenum As ElementEnumerator Dim myelement As Element Dim pattern As HatchPattern Set niveau = Application.ActiveDesignFile.Levels("Shape") critere.ExcludeAllLevels critere.IncludeLevel niveau Set elenum = Application.ActiveModelReference.Scan(critere) elenum.Reset While elenum.MoveNext Set myelement = elenum.Current Set pattern = CreateHatchPattern1(1, radians(45)) myelement.AsClosedElement.SetPattern pattern, Matrix3dIdentity myelement.Rewrite Wend End Sub
With this code I get associative paterns with every closed element of "Shape" level . So I want to have a non-associative paterns.
Is the Association Lock on? You can test it using
If ActiveSettings.AssociationLockEnabled Then ... End If
If necessary, you can turn off the association lock before you create the pattern.
I turned it off by adding ' ActiveSettings.AssociationLockEnabled = False ' before creating pattern but it didn’t change anything, the pattern still associative. I did something wrong ?