Batch STL check - Output Status?

Batch STL check - Output Status?

Anonymous
Not applicable
1,755 Views
7 Replies
Message 1 of 8

Batch STL check - Output Status?

Anonymous
Not applicable
Hi World...

I want to run an STL check on a batch of objects at once and output the results to a txt file.

I am fairly competent with maxscript, but i am not sure how to access the output from the Status box of the STL check modifier... is it possible to interigate this vaulue?

I cant find a reference to it anywhere..Anyone know how?

I am using MAX2010
0 Likes
1,756 Views
7 Replies
Replies (7)
Message 2 of 8

Anonymous
Not applicable

Sorry for digging up a very old post, but I'm having the same issue... 10 years later.

It's the only place where I find a reference to this problem.

 

Even the documentation of 3ds Max about modifiers gives no solution :

https://help.autodesk.com/view/3DSMAX/2020/ENU/?guid=GUID-C6B059C5-0A79-43BF-AD26-97305BF4B5D1

And I check different version of the documentation... No solution.

It's basicly the same each year.

 

I'm using python with MAXScript but if anybody has a solution with C++/MaxPlus I'll take it too

 

Please help me

0 Likes
Message 3 of 8

Anonymous
Not applicable

Thanks to the 3ds Max discord, someone (EricB_NY [D3V]) gave me the good idea to get around this problem.

The idea is to use the "select faces" option which can select all the faces or edges with problems.

You just have to get the selection with "getFaceSelection" or "getEdgeSelection" with your object in parameter.

Then you just check which faces or edges are selected and it's over.

In Pyhton it look like this (sorry MAXScript user) :

import pymxs
from pymxs import runtime as rt


#obj = the object you want to test
obj = rt.Teapot()
try:
    rt.addModifier(obj, rt.STL_Check()) 
except:
    print("Object is not usable with this modifier")

# obj.modifiers[0] -> get the first modifier of the modifier list (the upper one) of the object

# Activate the check
obj.modifiers[0].Check_Now = 1
# Define which check you want to use (here the open edges check)
obj.modifiers[0].Selection_Type = 0
# Define which part of the mesh you want to select (it depends on the check you're doing)
# Here I select the faces 
# /!\ The documentation is wrong (for python at least) : "Select_Faces = 1" => select the faces of the mesh and "Select_Faces = 2" => select the edges of the mesh
obj.modifiers[0].Select_Faces = 2
# You might need a pause in your script here depending on the size of your object
# Get all the faces of your object (has boolean)
afterCheckOpenEdges = rt.getEdgeSelection(obj)
cptError = 0 # The number of double faces
for isSelectedEdge in afterCheckOpenEdges : # For each face of your object
    if isSelectedEdge : # If the face is selected
        cptError +=1 # We increment the number of double faces
if cptError > 0:
    print("There are "+str(cptError) +" open edges in the object "+obj.name)
else : 
    print("No problem here !")

 

Hoping this will help someone.

If you have any question I'll be gald to answer

Message 4 of 8

EricsUsername
Enthusiast
Enthusiast

Glad to see you found your way!
Thanks for archiving the information.

0 Likes
Message 5 of 8

denisT.MaxDoctor
Advisor
Advisor

is it not easier to get open mesh edges as:

(meshop.getOpenEdges obj.mesh).numberset

?

0 Likes
Message 6 of 8

Anonymous
Not applicable

Yes it is but it's just an example. STL check provides other checks :

https://knowledge.autodesk.com/support/3ds-max/learn-explore/caas/CloudHelp/cloudhelp/2016/ENU/3DSMa...

In my case, I use it for doubles faces and spikes.

0 Likes
Message 7 of 8

EricsUsername
Enthusiast
Enthusiast

// It was a light chat in Discord that didn't get specific past;  STL and wanting to find faces.
I'm sure he could fine tune it.. in fact, I'd be surprised if Scriptspot didn't already have a similar tool.

0 Likes
Message 8 of 8

NicoC
Contributor
Contributor

Hello there 🙂

I bump on this one. I'd need to read the Status of the STL Check, the number of errors if any ... is there any chance for the devs to expose this to MXS, please ?

 

Thanks in advance !

 

Regards.

0 Likes