I see. Sorry, I misunderstood what you were trying to convey.
My problem wasn't putting something in a loop. What I am trying to figure out is how to change an element's visual properties during/directly after creation rather than by a selection method.
The link in the OP has my code...
@ferdo :
The code in my second post works (which is what you have edited)... I'm looking for a fix to the original post code which attempts to change the color of an element during/directly after it is being created.
Example:
- Loop start
- Create element
- Change VisProperty
- Loop
The code that I posted directly to the forum works great. It is the code within my original post's link that I'm having problems with. The second post makes a selection based on the circle radii. What I want to do is make color changes to an element directly after or during its creation.
There is no VisProperties class (I think class is what its called), only VisPropertySet and VisualizationSettingAtt.
The VisPropertySet class only seems to work when something is "selected". If I can find a way to "select" the element that was just created, I think I can make it work. I'm...
I used this to select the circles with a given radius and change the color of the selection:
Dim selection1 As selection
Set selection1 = partDocument1.selection
selection1.Search "CATPrtSearch.GSMCircleCtrRad.Radius=0.125in,all"
Dim VisPropSet As VisPropertySet
Set VisPropSet =...
I'm a bit new to programming VBA code for CATIA, so please bear with me. I'm creating some code to make circles along a plane via an Excel spreadsheet. As some background, I recorded some macros as a basis for my code and inserted my own programming. Everything works great EXCEPT for the part...