Script filtering and Folded beams

Script filtering and Folded beams

Masibanda-CE
Collaborator Collaborator
2,088 Views
26 Replies
Message 1 of 27

Script filtering and Folded beams

Masibanda-CE
Collaborator
Collaborator

I have script filters that look for all the different DSTV codes for use in Drawing processes and Dimension requests. They tend to work rather well with the exception of "Folded beams". Folded beams seem to return "True" for all DSTV code scripting. Does anyone experience this or understand why this would be?

The most recent example is a Dimension request that is filtering for points of a T section, but is picking up the points of a Folded beam.

0 Likes
Accepted solutions (1)
2,089 Views
26 Replies
Replies (26)
Message 2 of 27

Sebastian_Eiche
Mentor
Mentor

You could filter them out before asking for the DSTV Types.
Should be something like:

If Obj.IsKindOf(kfoldedBeamClass) 'Checking for unfolded objects
   Then
   Else                      
End If

Sebastian Eiche
Application Engineer @Mensch und Maschine acadGraph

EESignature

If this information was helpful, please use the Accept as Solution function, this make it easier for other users

0 Likes
Message 3 of 27

Masibanda-CE
Collaborator
Collaborator

@Sebastian_Eiche 

So what you're saying is that I need to add that into my existing script for "Tees" in order to keep them out? How do you insert that into this:

 

'Check for T profile
Function checkElement(Obj)
checkElement = False
If Obj.IsKindOf(kBeamStraightClass) Then
ProfTypeX = Obj.getProfType.getDSTVValues.DSTVType
If ProfTypeX = 8 Then
checkElement = True
End If
End If
End Function

 

Do I add .... "&&Obj.IsNotKindOf(kfoldedBeamClass)" befor the THEN statement?

 

 

If this works then GREAT! But why are folded beams sneaking through all DSTV type filters??????

0 Likes
Message 4 of 27

Sebastian_Eiche
Mentor
Mentor

not sure if "notkindof..."works, my first idea would be:

 

Function checkElement(Obj)
checkElement= False
'check for unfolded
	If Obj.IsKindOf(kBeamUnfoldedClass)  
	Then        
	Else 
	'Check for T profile
		If Obj.IsKindOf(kBeamStraightClass) Then
				ProfTypeX = Obj.getProfType.getDSTVValues.DSTVType
				If ProfTypeX = 8 Then
				checkElement = True
				End If
		End If

    End If
End Function

Sebastian Eiche
Application Engineer @Mensch und Maschine acadGraph

EESignature

If this information was helpful, please use the Accept as Solution function, this make it easier for other users

0 Likes
Message 5 of 27

Masibanda-CE
Collaborator
Collaborator

@Sebastian_Eiche 

Thanks but that didn't work, error message appeared to crash with "kBeamUnfoldedClass".

0 Likes
Message 6 of 27

Sebastian_Eiche
Mentor
Mentor

could you upload a small model and show what should be the result maybe we missunderstood each other


Sebastian Eiche
Application Engineer @Mensch und Maschine acadGraph

EESignature

If this information was helpful, please use the Accept as Solution function, this make it easier for other users

0 Likes
Message 7 of 27

ChristianBlei
Advisor
Advisor

Hi Gary,

 

this script works for As2020 and As 2021

 

 

Function checkElement(Obj)
checkElement= False
'check for unfolded
MsgBox("Start checking")
If not Obj.IsKindOf(kBeamUnfoldedClass) and Obj.IsKindOf(kBeamStraightClass) Then
MsgBox("Is straight beam- valid")
ProfTypeX = Obj.getProfType.getDSTVValues.DSTVType
MsgBox("ProfType is " + cstr(ProfTypeX))
If ProfTypeX = 0 Then
MsgBox(cstr(Obj.getProfType.getRunname))
checkElement = True
End If
elseif Obj.IsKindOf(kBeamUnfoldedClass) Then
MsgBox("Is folded beam- invalid")
End If
End Function

 

 

HTH,

Christian

Christian Blei
CBT Christian Blei Tools
christianblei.de
youtube.com/channel/UCxjA_NbeScQy9C0Z1xjwXpw
0 Likes
Message 8 of 27

Masibanda-CE
Collaborator
Collaborator

@ChristianBlei  @Sebastian_Eiche  Thanks guys, but there's something still amiss with applying the script within Drawing styles. See the video ....

 

 

0 Likes
Message 9 of 27

Sebastian_Eiche
Mentor
Mentor

is this object really a plate?or is it a foldedbeam? 

a folded plate should set the checkelement to false, so we have a few option here:

  • wrong dimension rule (maybe the dimension exist because of another line of the rule?)
  • it is bug 😃 

What version (installed language) do you use?

 

Edit:
If I use the script for filtering in processes, Christians and the other from me are working. So the problem is maybe only by using it as filter for modelobject in dimensions


Sebastian Eiche
Application Engineer @Mensch und Maschine acadGraph

EESignature

If this information was helpful, please use the Accept as Solution function, this make it easier for other users

0 Likes
Message 10 of 27

Masibanda-CE
Collaborator
Collaborator

@Sebastian_Eiche

The object was created using the “Folded beam” tool. As a DSTV type it should be 14 (no way to be sure without Autodesk feedback) but it certainly isn’t a T or 8.

The dimension request is looking for 2 selections; the extreme size as reference and the T center, there’s nothing else.

We’re running v2020 and multiple languages.

 

I agree, there is nothing wrong with the script when you just run it but it doesn’t work within the drawing styles.

0 Likes
Message 11 of 27

Sebastian_Eiche
Mentor
Mentor

The question is: if you delete this line in the dimension rules, does the dimension really be deleted on the detail drawing?

I only want to be sure, that we don't try to find the error but maybe this dimension is appearing because of another line of the dimension rule


Sebastian Eiche
Application Engineer @Mensch und Maschine acadGraph

EESignature

If this information was helpful, please use the Accept as Solution function, this make it easier for other users

0 Likes
Message 12 of 27

Masibanda-CE
Collaborator
Collaborator

@Sebastian_Eiche    yes, with the dimension request removed the dimension string no longer gets created.

0 Likes
Message 13 of 27

Sebastian_Eiche
Mentor
Mentor

I did some tests:

the scripts are not working for dimension and label strategy.
I will do some additional test and will come back with more informations


Sebastian Eiche
Application Engineer @Mensch und Maschine acadGraph

EESignature

If this information was helpful, please use the Accept as Solution function, this make it easier for other users

0 Likes
Message 14 of 27

ChristianBlei
Advisor
Advisor

Hi Sebsatian,

 

are the buggy or do you think they are not implemented?

 

best,

Christian

Christian Blei
CBT Christian Blei Tools
christianblei.de
youtube.com/channel/UCxjA_NbeScQy9C0Z1xjwXpw
0 Likes
Message 15 of 27

Sebastian_Eiche
Mentor
Mentor

the filter itself are working, but the problem is another one in my opinion.

IF i set the model object to "all objects" the filter is not working (this is known) so you always have to set a model object like "beams"

Now the T is a beam and there's an extra modelobject for folded beams. Normally the model object "beams" should select out the folded beams, but the folded beams are recognized nevertheless. I had no idea why. 

 


Sebastian Eiche
Application Engineer @Mensch und Maschine acadGraph

EESignature

If this information was helpful, please use the Accept as Solution function, this make it easier for other users

0 Likes
Message 16 of 27

ChristianBlei
Advisor
Advisor

Hi Sebastian,

I do not agree.

Unfolded is a (straight) beam and if you test unfolded for being a beam it has to pass the test.

Unfolded is a kind of specialized beam, but it inherits from straightbeam which inherits from beam..

In .Net I can check if the filerobject of a unfolded is a Beam, or a StraightBeam or an UnfoldedStraightBeam. All returns true.

By the way: the profiletype of unfolded is 31. Maybe you can try this value in your tests.

 

best, Christian

 

Christian Blei
CBT Christian Blei Tools
christianblei.de
youtube.com/channel/UCxjA_NbeScQy9C0Z1xjwXpw
0 Likes
Message 17 of 27

gabriel.costin
Alumni
Alumni

@Masibanda-CE 

Things are not so flexible in this area.
I think is better to focus on keep it as straightforward possible.
I hope I'm not missing anything, but I don't see why to check that isn't a folded beam, since the T shape condition is going to filter out anyway the folded beam.
I'd recommend also to begin with the model object "attached beam" (instead of "beam") and if everything goes well, try "relaxing" this condition further by using "beam" as model object.

Everything is important and interact differently based on how they are combined: model object, properties invoked in filter, where they are used (e.g. Mp drawing...).
There are situation when even for the simplest filter demand (a section shape), it's not going to work for model object "Beam", but it's going to work for "Main part beam".
So my recommendation is to start your check with the best targeted model object for your situation, having into consideration also where you are going to use it (e.g. Mp drawing).

0 Likes
Message 18 of 27

Masibanda-CE
Collaborator
Collaborator

@gabriel.costin 

You're correct there should be no reason to check if it is folded or unfolded for that matter. Logic would dictate that the simple DSTV filter for a "T" should work regardless. I will try using the "AttachedPart" Model object.

Your statement:


There are situation when even for the simplest filter demand (a section shape), it's not going to work for model object "Beam", but it's going to work for "Main part beam".

both intrigues and infuriates me .... why does it matter if an object is "main" or "attached" when at its core DSTV identity it can not be filtered? Do you have a list of token hierarchies that scripts search through?

0 Likes
Message 19 of 27

Masibanda-CE
Collaborator
Collaborator

@gabriel.costin 

Using the "AttachedPart" filter caused even more confusion. Now that dimension request is collecting center points from ALL attached objects - angles, plates, foldedbeams.

2020-07-22_10-29-42.png

 

0 Likes
Message 20 of 27

gabriel.costin
Alumni
Alumni

Please try to use AttachedBeams, since you are about to invoke a property (section shape) that is available for beams only, while AtttachedPart means plates too.
As far as I know, you should use ProfTypeX = 8 for T shapes.
If you want to check if the AttachedBeam does its job properly in conjunction with a filter, you can check it with an existing predefined filter (e.g. profile angle).

 

Unfortunately I can't provide you more insights about those inconsistencies that you are saying. I can only speculate that one of the reasons can be what Christian mentioned, regarding how the objects are organized at code level. We've recently started to leverage usage of these filters (couple of years ago) by providing some out of the box ones, that allowed to accomplish additional requirements for detailing. I perfectly understand although that there is room for much more in here.
I'm not a specialist within this domain, but I guess that API documentation can provide some clues on these code hierarchies.
I've mainly shared with you this behavior as from user perspective, in order to narrow down your attempts, being aware that it can be very time and energy consuming.

0 Likes