Jump to content

Juliensv

Member
  • Posts

    33
  • Joined

  • Last visited

Everything posted by Juliensv

  1. Hi there, Stumbled on this thread, and remembered a function that might be relevant. GetClosestPt seems to do the exact job you want, you give it the handle of your object and a coordinate, and it should give you the index of the vertex closest. Hope this helps, or is at least interesting. https://developer.vectorworks.net/index.php/VS:GetClosestPt
  2. Hi Nikolay! I am using VW 2022 on macOS Big Sur. Here is a test file. As you can see, the data tag is highlighting objects which are in the invisible "loft" class. Another unwanted behaviour on my end, is that the tool is able to highlight objects behind other objects, such as framing of the floor in this example. This behaviour is not matched when using data tags in design layers. Thank you for any insight you may have! Data Tag Test.vwx
  3. Hello, I have been having difficulty using data tags in the Sheet Layer Viewport annotations. Its seems that no matter what I do, the data tag tool will try to snap and associate to objects that are in invisible classes, or it will preferentially snap to objects which are behind objects in the foreground. All the objects are symbols. I'm wondering whether anyone knows the reason for this behavior, and/or any solutions to it? Attached are images with examples of both behaviours. Thank you!
  4. Sorry! This is a holdover from when I was trying it with just circles rather than symbols. I have actually gotten this to work for my use case using PickObject, however the symbols need to be in the active class, the polyline in a different class, and the script sets the class options to Active Only, or else it only ever picks up the polyline, rather than the symbols. There is probably a way to make this symbol/record agnostic, but that's beyond my scope! Thank you so much for this! I have been struggling to wrap my head around the FindObjAtPt functions, and this is an extremely helpful example! I may try to reimplement my script using FindObjAtPt rather than PickObject if I ever need it in the future!
  5. Hello, I need to sequentially number a large number of LED Nodes so that they can be addressed and pixel mapped. These nodes are symbols which have a record attached, and I need to number them in the record field. I have already created polylines representing the signal path along the nodes, so my first thought was to write a script that essentially checks along the polyline and numbers each symbol in the order it finds them. I have written a script using DistAlongPoly to find x/y coordinates along the polyline in increments, and check these coordinates for a symbol using ForEachObjectAtPoint. However, it never seems to see the symbols. I have tried using just circles and it has worked just fine, but the symbols never seem to be picked up by ForEachObjectAtPoint! Do y'all know of other functions to select/modify symbols based on graphical coordinates? Or maybe there is another direction I can be going here? Attached is an example picture of the nodes and polyline, as well as the script I wrote. PROCEDURE NumberNodesAlongLine; VAR h, nodeHdl, DTHdl: HANDLE; x, y, z : REAL; dist, incr : REAL; tangent, pt : VECTOR; nodeList : ARRAY [1..341] OF HANDLE; nodeNum, i : INTEGER; symbolDef, recordDef, recordField : STRING; nodeMatch : BOOLEAN; FUNCTION CheckObjCallback(h : HANDLE) :BOOLEAN; {or FUNCTION CheckObjCallback(h : HANDLE; px, py : REAL) : BOOLEAN;} {or FUNCTION CheckObjCallback(h : HANDLE; px, py, pz : REAL) : BOOLEAN;} BEGIN {only polylines are okay} IF GetTypeN(h) = 21 THEN CheckObjCallback := TRUE; END; {tests the symbols given to it and adds them to an array if} {they are the right symbol, and are not already in the list} FUNCTION GetUniqueSymbolsList(objHdl : HANDLE) :BOOLEAN; BEGIN IF GetType(objHdl) = 6 THEN BEGIN{check if is symbol and correct definition} IF nodeNum = 0 THEN BEGIN {if first node, just add it to array} nodeList[1] := objHDL; nodeNum := 1; END ELSE BEGIN{check if node is already in array} nodeMatch := FALSE; FOR i:=nodeNum DOWNTO 1 DO BEGIN IF nodeList[i] = objHdl THEN BEGIN nodeMatch := TRUE; i:= 1; END; END; IF nodeMatch = FALSE THEN BEGIN{If Node is not already in array, add handle to array} nodeNum := nodeNum + 1; nodeList[nodeNum] := objHdl; END; END; END; GetUniqueSymbolsList := TRUE; END; BEGIN symbolDef := 'LED NODE'; recordDef := 'lED Node Data'; recordField := 'Node ID'; WHILE h = NIL DO {while no handle has been passed over, repeat the pick object function} BEGIN TrackObject( CheckObjCallback, h, x, y, z ); IF h <> NIL THEN SetSelect( h ); END; dist := 0;{starting distance} incr := 0.375;{increment of checking distance} nodeNum := 0;{Number of unique nodes found} {Checks along a polyline by increments and creates a list of unique nodes along the line} WHILE PointAlongPoly(h, dist, pt, tangent) DO BEGIN {Locus(pt[1],pt[2]);} ForEachObjectAtPoint(GetUniqueSymbolsList, 0, 0, pt[1], pt[2], 2); dist := dist + incr; END; FOR i:= 1 TO nodeNum DO BEGIN nodeHdl:= nodeList[i]; SetRField(nodeHdl, recordDef, recordField, Concat(i)); END; END; RUN( NumberNodesAlongLine );
  6. As far as I know, the quality of your renders are not determined by your graphics card, or by the settings in the Nvidia control panel. I would recommend you never to change the settings in the Nvidia control panel anyways, because those are usually for gaming or other real-time rendering. The only thing that upgrading your graphics card will do is maybe speed up your renders. Anti-aliasing will help you a little bit, but the real solution is just to bump up your DPI. I regularly use 300 dpi when rendering OpenGL, and I use 150 DPI as an absolute minimum. The reason it looks better in the design layer is likely because your screen has a higher DPI, or because you're able to zoom into the design layer, whereas, sheet layer viewports render at a fixed dpi.
  7. Got it! All renamed properly so they can work. Toolset Icons.zip
  8. Since the toolset icons are decidedly not located in the app package, and since nobody else has done it, I took the liberty of decoding all the Base 64 icons from the workspace files. It does boggle the mind somewhat that these are not just available as a drop-down or something when creating a new toolset. Here they are individually, as well as in a zip. Hope they are useful... (Updated zip file in thread further down)
×
×
  • Create New...