element is inside range of another element

Hi, How could I find that one element is inside range of another element? Would be very thankful if someone provides example how to use RangeOption.Inside from Bentley.GS library

Thanks in advance

Parents
  • Hi Peter,

    RangeOption.Inside is one of the possible values of an input property that requires type "RangeOption" input, e.g. "RangeAction" in any geometry node type's "FromElementsInRange( )" technique.

    An approach to finding an element's range is most likely through a geometry node's output property "DRange3d", which contains a Low and High value in form of a DPoint3d with an x, y, and z coordinate value. Those form an X, Y, Z axis aligned bounding box as diagonal corner points.

    Comparison of X, Y, and Z-values of those range points then yield information whether the elements' ranges overlap or one is entirely contained in the other. Note that the easiest check is for exclusion because the bounding box check is common in algorithms to reduce processing of overlapping or otherwise intersecting geometry.

    Those DPoint3d type points can also be converted to Point nodes using the FromDPoint3d( ) technique and used to create Range nodes ByLowHighRangePoints( ).

    HTH,

    Volker

       

  • Thanks Volker for great answer!
    Range Node has method SelectNodesWithinRange(NodeRange [, RangeAction [, CheckNestedNodesAgainstRange [, SearchHeterogeneousList [, OptionalMonitor [, ScaleFactor]]]]] ). Could you please explain idea behind this function (SearchHeterogeneousList , OptionalMonitor , ScaleFactor)? I guess it should return all nodes (geometric entities) inside range and it does search in whole model. Could I somehow limit amount of entities it will look through (for example a replicated node or list of entities?
    Thanks in advance.
  • Hi Peter, you are welcome. (Please click Verify Answer above.)

    Your follow-up question points to a gap in the GC documentation.

    SelectNodesWithinRange( ) is one of those techniques which is standard for all node types. In the case of Range.SelectNodesWithinRange( ) it may be a bit confusing because it appears recursive. Range.SelectNodesWithinRange( ) is useful if a user has a GC model which contains several Range nodes, and the goal is to select some of those based on yet an additional Range, which is provided as input to NodeRange, e.g. created as Range.ByLowHighRangePoints( ).

    Range nodes in general are comparable to Fence selection. In GC the Range is explicitly 3-dimensional. Per se, unless there is some half-space type subdivision of the file data, selection tools like Fence and Range (or frame selection with the cursor) have to scan all entities in a file quickly whether they meet the initial selection requirements, which is the location. This is commonly done with a very fast range check, quickly excluding entities that are outside the selection range.

    Square brackets around input properties indicate that these are optional. If a user does not want to provide those inputs, then that's OK. In most cases, GC uses meaningful default values.

    RangeAction sets the primary condition for where the selection range is located (inside, outside, overlap), again very similar to the Fence selection tool. The default value is "Inside". CheckNestedNodesAgainstRange lets users scan nested nodes, e.g. replicated nodes, component-by-component whether they match the location requirement. The default is "false" because the computational effort increases with this option. When "true", GC has to scan nested nodes even if the top level node does not meet the initial quick exclusion check, to see whether any of the contained nodes meet the condition and need to be included in the selection. It seems to be ineffective in GC V8i Ss6 Update 1.

    OptionalMonitor is not used. It may have been intended for future use.

    ScaleFactor scales the size of the range by the factor entered. Values less than 1 make the size of the range smaller and hence cause fewer entities to be selected. Values greater than 1 increase the selection range. Default value is 1 so that the selection range coincides with the visible Range node geometry.

    I hope this clarifies use of Range in general, and Range.SelectNodesWithinRange( ) in particular.

    Regards,

    Volker

       

    Answer Verified By: peter bojarov 

Reply
  • Hi Peter, you are welcome. (Please click Verify Answer above.)

    Your follow-up question points to a gap in the GC documentation.

    SelectNodesWithinRange( ) is one of those techniques which is standard for all node types. In the case of Range.SelectNodesWithinRange( ) it may be a bit confusing because it appears recursive. Range.SelectNodesWithinRange( ) is useful if a user has a GC model which contains several Range nodes, and the goal is to select some of those based on yet an additional Range, which is provided as input to NodeRange, e.g. created as Range.ByLowHighRangePoints( ).

    Range nodes in general are comparable to Fence selection. In GC the Range is explicitly 3-dimensional. Per se, unless there is some half-space type subdivision of the file data, selection tools like Fence and Range (or frame selection with the cursor) have to scan all entities in a file quickly whether they meet the initial selection requirements, which is the location. This is commonly done with a very fast range check, quickly excluding entities that are outside the selection range.

    Square brackets around input properties indicate that these are optional. If a user does not want to provide those inputs, then that's OK. In most cases, GC uses meaningful default values.

    RangeAction sets the primary condition for where the selection range is located (inside, outside, overlap), again very similar to the Fence selection tool. The default value is "Inside". CheckNestedNodesAgainstRange lets users scan nested nodes, e.g. replicated nodes, component-by-component whether they match the location requirement. The default is "false" because the computational effort increases with this option. When "true", GC has to scan nested nodes even if the top level node does not meet the initial quick exclusion check, to see whether any of the contained nodes meet the condition and need to be included in the selection. It seems to be ineffective in GC V8i Ss6 Update 1.

    OptionalMonitor is not used. It may have been intended for future use.

    ScaleFactor scales the size of the range by the factor entered. Values less than 1 make the size of the range smaller and hence cause fewer entities to be selected. Values greater than 1 increase the selection range. Default value is 1 so that the selection range coincides with the visible Range node geometry.

    I hope this clarifies use of Range in general, and Range.SelectNodesWithinRange( ) in particular.

    Regards,

    Volker

       

    Answer Verified By: peter bojarov 

Children
No Data