Jump to content
Developer Wiki and Function Reference Links ×

Select door/window with TrackObjectN?


Recommended Posts

Don't know about TrackObjectN, in this instance I don't know if you would really need the traversal specification, but here's a short script that works for doors and windows that are embedded in walls:

Quote

PROCEDURE GetDoorWindow;

VAR

    trackHand:HANDLE;
    trackLoc:POINT3D;

FUNCTION CheckObjCallback(h:HANDLE) : BOOLEAN;

{Provides Callback for selecting Doors and Windows inserted into Walls}

    VAR
    
        recName:STRING;
        parentHand:HANDLE;
        
    BEGIN
        recName:=GetName(GetRecord(h,NumRecords(h)));
        parentHand:=GetParent(h);
        
        IF(((recName='Door') | (recName='Window')) & (GetTypeN(parentHand)=68)) THEN CheckObjCallback:=TRUE;
    END;

BEGIN
    TrackObject(CheckObjCallback,trackHand,trackLoc.x,trackLoc.y,trackLoc.z);
END;

Run(GetDoorWindow);

 

 

Edited by Jesse Cogswell
Link to comment

It determines how deep the track goes.  If you are tracking objects that are inside of symbols or groups, that's how you would specify it.  Somewhere deep in the function reference it describes the difference between shallow and deep traversal, but I couldn't find it last time I looked.  I remember deep traversal going through all containers (walls, extrudes,sweeps,groups), but don't remember what shallow traversal specifies.

 

Every time I've used TrackObject it's been to track something in design layer or sheet layer space, so no need to traverse at all.  So I just use the standard TrackObject function.

 

The documentation for Vectorscript is often times either very cryptic or straight up missing.  I spent last week delving into the four different procedures/functions for offsetting a polygon and the documentation is laughable.  I finally landed on using OffsetPolyN which offsets a polygon in document units instead of defaulting to millimeters, but doesn't close the resulting poly.  The function reference has no example and just says, "Offsets a polygon or polyline. Uses Parasolid to do it. Equivalent of Voronoy based OffsetPoly."  Which is still better than OffsetPoly, which reads more like a requirement doc than useful documentation: "Offsets a polygon or polyline. Must handle open & closed polys. A positive distance offsets to the outside; negative to the inside. Should remove self-intersecting segments from the result. Should support smooth vs. sharp offsets."

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...