jissididi
Automotive
- Mar 17, 2015
- 46
Hi all,
I made a macro in which one I create Planar Sections (lot of them).
As the planar section creation is not scriptable (because it needs user to click on buttons) it creates the planar sections beginning from PlanarSection.1 and then 2,3,4,5,6...
But you would know that if there were already planar sections created in the part before, the name of the new planar section created would begin according to the last planar section iteration created.
Thus the only 2 options I had to be able to accurately select the planar section I wanted (to change visproperties) were :
1)- create geo set with its own name ex : geo_set_1, copy the first planar section, paste it in the geo set created and delete it from the old geo set. (very heavy in time consumption)
2)- select all the planar sections created, get the BREP name of the first Item (or the fifth, tenth...), and select it (This would be the better solution for me)
Fact is, I don't know how to get the name of one of the planar sections item in particular...
here is the idea :
Now what I want is to select the planar section Item I'm interested in to change its visual properties thanks to the name saved in the array I filled previously.
Does anyone knows How to do it?
Truth is I have been looking for a while in internet but never found this thread in any forum...
Thank you.
I made a macro in which one I create Planar Sections (lot of them).
As the planar section creation is not scriptable (because it needs user to click on buttons) it creates the planar sections beginning from PlanarSection.1 and then 2,3,4,5,6...
But you would know that if there were already planar sections created in the part before, the name of the new planar section created would begin according to the last planar section iteration created.
Thus the only 2 options I had to be able to accurately select the planar section I wanted (to change visproperties) were :
1)- create geo set with its own name ex : geo_set_1, copy the first planar section, paste it in the geo set created and delete it from the old geo set. (very heavy in time consumption)
2)- select all the planar sections created, get the BREP name of the first Item (or the fifth, tenth...), and select it (This would be the better solution for me)
Fact is, I don't know how to get the name of one of the planar sections item in particular...
here is the idea :
Code:
geoset = "Name_Of_The_Geo_Set_I_Have_Created_My_Planar_Sections_In"
oSelection.Search ("Name=" & geoSet) ''''''''''''''''''''' I select the geoset in which one are the planar sections I'm interested in
oSelection.Search "CATPrtSearch.SkinFeature,sel" ''''''''' I search for the planar sections Item in the geoset previously selected and select them
For i = 1 To oSelection.Count '''''''''''''''''''''''''''' I make a loop to get the name and save them in an array I created before
Set brepresentation = oSelection.Item(i).Value ''''''' I get the Value of the item I want to save its name next in the array and be able to get its name after
brepresentationname = brepresentation.Name ''''''''''' I get the Name of the selection item (i) (gives me "CLDGeom.174" for exemple I guess it is its BREP name)
MsgBox brepresentationname ''''''''''''''''''''''''''' This is to check the Name of the selected Item
arr(i) = CStr(brepresentationname) ''''''''''''''''''' This is to save the name in the array
Next
Now what I want is to select the planar section Item I'm interested in to change its visual properties thanks to the name saved in the array I filled previously.
Does anyone knows How to do it?
Truth is I have been looking for a while in internet but never found this thread in any forum...
Thank you.