Notifications
Clear all

[Closed] Edit mesh,select Polygon by ID

I have a script that extrude some shapes one by one. And I want to had a thing to it. See the comment :

sel = selection as array
     for i in 1 to sel.count do (
     	if superclassof sel[i] == shape do  (
     		print sel[i].name
     		addModifier sel[i] (extrude amount:9)
     		addModifier sel[i] (Edit_Mesh ())
     		sel[i].name = "House"
     		sel[i].wirecolor = color 38 200 0
     		-- THEN .....
      		-- Open the edit Mesh Panel
      		-- Select the POLYGON sub-menu
      		-- select the Polygon by his Smoothing Groups ID that I know is "5"
      		-- and extrude this Polygon by an amount of my choice
     	 )
     )
 Is there a way to do that ?
 
 Which function should I use ?
 
 Thanks in advance.
 
 Falchun
1 Reply

I’ve found my way with the following script. In fact I want to extrude by x the top of of an extruded spline. How can I extrude a selection of faces ?

for i in selection do (
  	 if superclassof i == shape do (
  		addmodifier i (extrude())
  		i.modifiers[#Extrude].amount = 6
  		i.modifiers[#Extrude].mapCoords = on
  		i.modifiers[#Extrude].matIDs = on
  		i.modifiers[#Extrude].smooth = on
  		i.modifiers[#Extrude].capType = 0
  		i.modifiers[#Extrude].capStart = on
  		i.modifiers[#Extrude].capEnd = on
   
  		addmodifier i (edit_mesh())
  		print i.numfaces
  		-- In a cube, so I select the two last faces
  		setFaceSelection i i.modifiers[#Edit_Mesh] #(11,12)
  		-- there I want to extrude this selection !!!
  	  )  
  )