VS:FindObjAtPt Create: Difference between revisions

From Vectorworks Developer
Jump to navigation Jump to search
m (1 revision)
 
No edit summary
Line 5: Line 5:
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<desc>
<desc>
Searches for specified objects inside specified container. The routines searches for planar object.
Creates object find for objects at specified point within specified radius. The funtion is capable of iterating</desc>
 
You must use [[VS:FindObjAtPt_Delete]] to delete the returned searcher instance.
</desc>


-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<def>
<def>
<funcDef lang="vs">
<funcDef lang="vs">
FUNCTION FindObjAtPt_Create(hContainer: HANDLE; objOptions: INTEGER; travOptions: INTEGER; locX: REAL; locY: REAL; pickRadius: REAL) : LONGINT;
FUNCTION FindObjAtPt_Create(hContainer:HANDLE; objOptions:INTEGER; travOptions:INTEGER; locX:REAL; locY:REAL; pickRadius:REAL) : LONGINT;
</funcDef>
</funcDef>
<funcDef lang="py">
<funcDef lang="py">
Line 27: Line 24:
hContainer
hContainer
HANDLE
HANDLE
The container that is to be searched. If passed NIL then it searches in the current layer.
 
</line>
</line>
<line>
<line>
objOptions
objOptions
INTEGER
INTEGER
Traversal options related to objects. See remarks for detailed values.
 
</line>
</line>
<line>
<line>
travOptions
travOptions
INTEGER
INTEGER
Traversal style. See remarks for detailed values.
 
</line>
</line>
<line>
<line>
locX
locX
REAL
REAL
X location to search at.
 
</line>
</line>
<line>
<line>
locY
locY
REAL
REAL
Y location to search at.
 
</line>
</line>
<line>
<line>
pickRadius
pickRadius
REAL
REAL
Search radius. Distance from (locX,locY) at which it will search for objects.
 
</line>
</line>
</lineList>
</lineList>
</params>
</params>


-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<return>
<remark></remark>
Returns searcher instance. Must be deleted with call to [[VS:FindObjAtPt_Delete]].
</return>


-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<remark>
<sample></sample>
Specific values for the parameters:
:*objOptions parameter:
::{| border=1
! Constant !! Value !! Meaning
|-
|kFindObjectOptions_AllObjs || 0 || Traverse all the objects.
|-
|kFindObjectOptions_VisibleOnly || 1 || Traverse only visible objects.
|-
|kFindObjectOptions_SelectedOnly || 2 || Traverse only selected objects.
|-
|kFindObjectOptions_UnlockedOnly || 3 || Traverse only unlocked objects.
|}
 
:*travOptions parameter:
::{| border=1
! Constant !! Value !! Meaning
|-
|kFindObjectTraversalOptions_Shallow || 0 || Traverse only the children of the container.
|-
|kFindObjectTraversalOptions_Groups || 1 || Traverse recursively the container.
|}
 
 
([[User:Orso.b.schmid|Orso]], 2008 Oct. 15): Finds objects at the point "Loc" starting from the parent container "hContainer". The routine returns a longint as list of objects (similar to BuildResourceList) which you'll use to manipulate the found objects. The suffix "create" stays then for "create a list". [[VS:FindObjAtPt_GetCount| FindObjAtPt_GetCount]](list) will return the count of found objects. [[VS:FindObjAtPt_GetObj| FindObjAtPt_GetObj]](list, i) returns a handle to the object at index "i. The index is 0-based.
 
It seems to ignore most object types. It will work with:
* lines, polylines, polygons, rectangles, arcs, 2D loci, pios.
Notably it will ignore:
* walls, symbols, round rects, ovals, 3D polys, 3D loci, nurbs, extrudes, dimensions, slabs....
</remark>


-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<sample>
<seeAlso></seeAlso>
<code lang="pas">
PROCEDURE Example;
VAR
  finderID : LONGINT;
  i, objCnt : INTEGER;
  h : HANDLE;
BEGIN
  finderID := FindObjAtPt_Create( NIL, 0, 1, 0mm, 0mm, 3mm );
 
  objCnt := FindObjAtPt_GetCount( finderID );
  FOR i := 0 TO objCnt-1 DO BEGIN
    h := FindObjAtPt_GetObj( finderID, i );
    AlrtDialog( Concat( 'found object ', i, ' of ', objCnt, ' h=', h ) );
  END;
 
  FindObjAtPt_Delete( finderID );
END;
RUN(Example);
</code>
</sample>


-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<version>
<version>
Availability: from All Versions
Availability: from Vectorworks 2014


This is drop-in function.
</version>
</version>
-----------------------------------------------------------------------------------------------------------
<seeAlso>
Related functions: [[VS:FindObjAtPt_Create]] | [[VS:FindObjAtPt_GetCount]] | [[VS:FindObjAtPt_GetObj]] | [[VS:FindObjAtPt_Delete]]
</seeAlso>


</vwDoc>
</vwDoc>


[[Category:VS Function Reference|FindObjAtPt_Create]]
[[Category:VS Function Reference|FindObjAtPt_Create]]
[[Category:VS Function Reference:Utility|FindObjAtPt_Create]]
[[Category:VS Function Reference:Graphic Calculation|FindObjAtPt_Create]]

Revision as of 17:36, 18 September 2013

.VectorScript|VectorScript ..VS:Function Reference|Function Reference ..VS:Function_Reference_Appendix|Appendix

Description

Creates object find for objects at specified point within specified radius. The funtion is capable of iterating

FUNCTION FindObjAtPt_Create(
hContainer :HANDLE;
objOptions :INTEGER;
travOptions :INTEGER;
locX :REAL;
locY :REAL;
pickRadius :REAL) : LONGINT;
def vs.FindObjAtPt_Create(hContainer, objOptions, travOptions, locX, locY, pickRadius):
    return LONGINT

Parameters

hContainer HANDLE
objOptions INTEGER
travOptions INTEGER
locX REAL
locY REAL
pickRadius REAL

Version

Availability: from Vectorworks 2014