michaelk Posted July 6, 2020 Share Posted July 6, 2020 Is it possible to use TrackObjectN in a script (not in a tool) to select a window or door object inserted into a wall? I keep getting a Type 68. Thanks! Quote Link to comment
Jesse Cogswell Posted July 6, 2020 Share Posted July 6, 2020 (edited) 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 July 6, 2020 by Jesse Cogswell Quote Link to comment
michaelk Posted July 6, 2020 Author Share Posted July 6, 2020 Thanks! That's really helpful. I wonder what the integer that "specifies how to traverse the drawing" means in TrackObjectN? Quote Link to comment
Jesse Cogswell Posted July 6, 2020 Share Posted July 6, 2020 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." Quote Link to comment
michaelk Posted July 6, 2020 Author Share Posted July 6, 2020 10 minutes ago, Jesse Cogswell said: The documentation for Vectorscript is often times either very cryptic or straight up missing. if it wasn't for this forum… Thanks for your help. Quote Link to comment
Recommended Posts
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.