Select objects with 0 vertices

Hello all,
i'm quite sure this is something that most of you can write down in 2 seconds.
I have an exported dataset where dummies are presented by objects with 0 vertices. I'd like to get rid of them, therefore i'd need all of the (visible) objects with zero vertices to be selected so i can isolate or delete them.

Thank you in advance,
Marcin

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Kstudio's picture

Use Select Empty Objects

Use Select Empty Objects  button in FixUtilities script
FixUtilities included in TrackScripts pack
Download page: http://3d-kstudio.com/scripts/trackscripts 

pokoy's picture

thank you so much!

thank you so much!

Anubis's picture

to delete them: for i in

to delete them:
for i in selection where (getPolygonCount i)[2] == 0 do delete i

and to isolate/deselect them:
for i in selection where (getPolygonCount i)[2] == 0 do deselect i

my recent MAXScripts RSS (archive here)

br0t's picture

aww i was too slow

aww i was too slow :(
@le1setreter: after looking at your approach, i added the "clearSelection()" and deleted the "isHidden" check.

wieder was gelernt, danke :)

macroScript selectZeroVerticeObjects
        category:"Custom"
        tooltip:"Select all Objects with 0 Vertices"
        buttontext:"Sel 0 VertObj"
(
	clearSelection()
	local selCount = 0
	for obj in geometry do
	(
		try
		(
			if (obj.numVerts == 0) do
			(
			selectMore obj
			selCount = selCount+1
			)--end if
		)--end try
		catch ()--end catch
	)--end for
	print (selCount as String+" Objects with 0 Vertices have been selected.")
)--end macroscript
AttachmentSize
selectZeroVerticeObjects.ms 478 bytes

Never get low & slow & out of ideas

le1setreter's picture

maybe this might help

maybe this might help you:

--epmty elsection
clearSelection()
 
--select all geometry objects
select(geometry)
 
-- one array for all geoemtry objects - and one array to place the identified objects into
allGeometry = selection as array
zeroVerts = #()
 
 
for i=1 to allGeometry.count do (
	if (classof allGeometry[i] == Editable_Poly) or (classof allGeometry[i] == Editable_mesh) or (classof allGeometry[i] == PolyMeshObject) do (
		if (allGeometry[i].numverts == 0) do append zeroVerts allGeometry[i]
	)
)
 
select(zeroVerts)

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.