Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

triangle confirmDialog error

triangle confirmDialog error

jayantbhatt07
Advocate Advocate
614 Views
4 Replies
Message 1 of 5

triangle confirmDialog error

jayantbhatt07
Advocate
Advocate

Working on a script where it will select triangle, It is working but that confirmdialog is not showing how many triangles are selected. Anyone knows how to fix it?

 

 



changeSelectMode -object;
string $sel[] = `ls -sl`;
int $badFaces = 0;

if (size($sel) < 1)
{
confirmDialog -t " Check your object selection. " -b "OK" -bgc 0.8 0.5 0 -ma "center" -m " You have not selected any object.Select Atleast 1 mesh. ";

}

polySelectConstraint -m 3 -t 8 -sz 1; //Select triangle
$toFaces = `ConvertSelectionToFaces`;
$faces = `ls -sl -flatten`;
{
confirmDialog -t "Checking for bad faces finished." -b "OK" -bgc 0.3 0 0 -ma "center" -m (" Mesh needs fixing ! Triangles are selected ( there are " + $badFaces + " triangles ). ");
}

0 Likes
Accepted solutions (1)
615 Views
4 Replies
Replies (4)
Message 2 of 5

lee.dunham
Collaborator
Collaborator

It doesn't look like you're actually storing the number of trianges you find in the badFaces variable.

I usually highlight the variable I have issues with and find all occurrences of it. This helps me see what is happening with the variable.

0 Likes
Message 3 of 5

rajasekaransurjen
Collaborator
Collaborator
Accepted solution

Hi,

Try this...

changeSelectMode -object;
string $sel[] = `ls -sl`;
int $badFaces = 0;
if (size($sel) < 1)
{
    confirmDialog -t " Check your object selection. " -b "OK" -bgc 0.8 0.5 0 -ma "center" -m " You have not selected any object.Select Atleast 1 mesh. ";
}
polySelectConstraint -m 3 -t 8 -sz 1; //Select triangle
$toFaces = `ConvertSelectionToFaces`;
$faces = `ls -sl -flatten`;
$badFaces = size($faces);
{
    confirmDialog -t "Checking for bad faces finished." -b "OK" -bgc 0.3 0 0 -ma "center" -m (" Mesh needs fixing ! Triangles are selected ( there are " + $badFaces + " triangles ). ");
}
0 Likes
Message 4 of 5

jayantbhatt07
Advocate
Advocate

Thank you so much

0 Likes
Message 5 of 5

jayantbhatt07
Advocate
Advocate

hightlight the variables how? Sorry I'm noob

0 Likes