Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

87 Excellent


About MullinRJ

  • Rank
    1000 Club

Personal Information

  • Occupation
    Circuit Board Designer
  • Location
    Dallas, TX

Recent Profile Visitors

1,389 profile views
  1. MullinRJ

    Learning Vector Work.

    Josue, The script @Pat Stanford showed you does not work when you are editing inside a Viewport's Annotation Space, nor inside any other container objects, i.e., Symbols, Groups, Profile space of 3D objects, etc. This is because of limitations of the FSActLayer function which only returns handles from selected objects on Design Layers and Sheet Layers. Do a search on "Waldo" in the Vectorscript Forum. You will get several hits that will show you a few lines that will return a handle to a selected object inside a container, like the Viewport's Annotation Space. Waldo is the nickname given to this kind of code that gets you a handle when you are not on a Design or Sheet Layer. Reference "Where's Waldo" to see where the name came from. Have fun and good luck, Raymond
  2. MullinRJ

    Get Symbol Instance from object in Symbol Def??

    Pat, Is the toilet symbol only used in the Bathroom symbol, or does it exist in other symbols, or by itself on the drawing? Can you post a sample file? I doubt I could recreate what you've got from your description. Raymond
  3. MullinRJ

    section arrow font

    As it was explained to me recently by Gunther Miller, the PRINT menu command is supported by APPLE, and the EXPORT menu options are support by Vectorworks. Thanks for submitting the BUG. Raymond
  4. MullinRJ

    section arrow font

    Also worth noting is that the problem does not present itself when using the PRINT menu to Print-To-PDF option. Raymond
  5. MullinRJ

    section arrow font

    Thank you for that. Could you attach a screenshot of the OIP? There are a lot of settings for this marker, and that would be a lot easier than listing them all separately. Or better yet, attach a small file that has your offending marker in it for others to examine. This should save a lot of guessing if the answer is not obvious. Raymond
  6. MullinRJ

    section arrow font

    What version of VW? What computer? What OS? You really need to add a signature with these items to get the best answers. TIA, Raymond
  7. MullinRJ

    Duplicate Symbol Script

    Hi Max, As I said, it is a "minimized" script. I must leave something for you to do ;-). Do you have the Script Reference handy? There are similar calls for 3D Symbol queries, and the naming of new symbols is very subjective. If you don't want the script to rewrite an existing one, then you will have to search for the existence of the new name. If you find it you will have to increment or change yours accordingly then check again, but there are many ways to approach this. Be creative. Gotta run now. If you have more questions post again. Heck, @PatStanford hasn't even weighed in on this. If he does you'll get another load of advice to follow. I'll check back later, Raymond
  8. MullinRJ

    Duplicate Symbol Script

    Hi Max, There is no need to duplicate a symbol instance to decompose a copy of it. Just decompose the original instance inside BeginSym() and EndSym, giving it a new name. To avoid problems later, it is best to do all your dirty work at the origin. Move symbol to (0, 0) and unrotate before demo and rebuild. To leave an instance in place, place the new symbol at the same XY/Rot as the original symbol when you are done. Here a minimized script to do just that. PROCEDURE MakeUnique; VAR Selection : HANDLE; X, Y, Rot :Real; BEGIN Selection := FSActLayer; { get handle to Sym } GetSymLoc(Selection, X, Y); { get insertion point } Rot := hAngle(Selection); { get rotation } hMove(Selection, -X, -Y); { movet to origin } hRotate(Selection, 0, 0, -Rot); { unrotate } BeginSym('Sym New'); SymbolToGroup(Selection, 0); if (GetTypeN(LActLayer) = 11) then Ungroup; EndSym; Symbol('Sym New', X, Y, Rot); { place new symbol on drawing } Sysbeep; { make noise when done } END; Run(MakeUnique); HTH, Raymond
  9. MullinRJ

    Duplicate Symbol Script

    Instead of using DoMenuTextByName(), use BeginSym() and EndSym calls before and after your duplication code, respectively. Raymond
  10. MullinRJ

    3D Polyline length

    Hi Julian, Interesting approach. I knew you'd approach it differently than I. When you said your code might be quicker, it got me thinking. Your code is definitely more concise (quicker to code), but with the create and delete operations the execution speed can be an issue if large numbers of Polys need processing. For small object counts (<1000), both routines execute fast enough to be efficient. However, given enough objects the NURBS routine can appear painfully slow. I measured the two routines processing 1K, 10K, and 100K 3D Polygons. Each poly had 10 vertices. Here's what I got. Poly | JC RM | JC RM Count | Ticks Ticks | Time Time 1K | 57 4 | .95s .07 s 10K | 551 21 | 9.2 s 0.35 s 100K | 5586 175 | 93.1 s 2.92 s Sam, Bottom Line: pick the routine that will work best for your application based on your expected object count. 1-1000 Polys, shorter code looks better and is easier to support. >1000 Polys, summing the vertex distances will be much faster. VectorScript can get data from objects and process numbers and calculations much faster than it can create and delete objects. Just something to keep in mind when designing your coding approach. HTH, Raymond
  11. MullinRJ

    Connect polyline endpoint to object/symbol

    Hi @Pat Stanford , you guessed it. I initially got hung up using "0". Once I used -1, it got easier. The second and third modes, Collinear and Parallel were much easier to guess how they worked, and with the tech note using symbol wasn't too hard either. Not to make two points of the same object coincident, but the call uses two points on an object to define an edge for Parallel, and Collinear. I'm not sure that's wha you mean, though. Raymond
  12. MullinRJ

    3D Polyline length

    Hi Sam, After a quick search, I could not find a function that works on 3D Poly, like hPerim() works on 2D Polys. It may be out there, but I could write the routine to sum the legs faster than I could search for a function that does or doesn't exist. But, @Pat Stanford is correct, I've already done that and found one in my script archive. Damn, I wrote it more than a decade ago. I'm getting old. Hey, it's another example using Vectors. DOUBLE BONUS! PROCEDURE Get3DPolyLen_Example; { 20 Dec 2008 - Raymond J Mullin } function Get3DPolyLen(H :Handle) :Real; { Return the perimiter length of 3DPoly H. If H is not a 3DPoly, return 0. } Var I, N :Integer; L :Real; P0, Pa, Pb :Vector; Begin L := 0; if (GetType(H) = 25) then begin N := GetVertNum(H); GetPolyPt3D(H, 0, P0.x, P0.y, P0.z); { 1st vertex } Pa := P0; { copy of 1st vertex } for I := 1 to N-1 do begin GetPolyPt3D(H, I, Pb.x, Pb.y, Pb.z); { vertices 2 through N } L := L + Norm(Pb-Pa); { NORM is the vector DISTANCE function } Pa := Pb; end; { for } if IsPolyClosed(H) then L := L + Norm(P0-Pb); { distance from last to first points } end; { if GetType } Get3DPolyLen := L; End; { Get3DPolyLen } BEGIN AlrtDialog(concat('3D Poly Length = ', Num2StrF(Get3DPolyLen(FSActLayer)))); END; Run(Get3DPolyLen_Example); HTH, Raymond PS - if a native function exists, my bet is @Julian Carr or @JBenghiat would know.
  13. MullinRJ

    Connect polyline endpoint to object/symbol

    @boro, It took a bit of trial and error for me to figure out how the SetBinaryConsrtaint() function works, but I finally got it. It is NOT intuitive! Here is a very simple example showing how to join the endpoints of two lines together. PROCEDURE SBC_1_Example; { Constrain two lines to share a common point. } { In this example, Pt1 of Line 1 (obj1VertA = 1) is to be coincident to Pt2 of Line 2 (obj2VertA = 2). } { Line 1 will move so its StartPoint is coincident with Line 2's EndPoint. Line 2 will not move. } { The angles of both lines will remain unchanged. } { } { Select two lines and run the script. Line 1 is the first selected object and Line 2 is the second. } { For option 1 (Coincident Points), the second vertex of each object is not needed, so -1 is passed to } { the "obj1VertB" and "obj2VertB" parameters, while 0 is passed to both "containedObj" parameters. } { } { At the end of the script, the Message Window shows the function's result (T/F) amd the numeric type } { of each selected object (LineType = 2).} { 27 Apr 2019 - Raymond J Mullin } VAR H1, H2 :HANDLE; result :BOOLEAN; BEGIN H1 := FSActLayer; { Line 1 handle } H2 := NextSObj(H1); { Line 2 handle } result := SetBinaryConstraint(1, H1, H2, 1, -1, 2, -1, 0, 0); message(result, ' ', GetTypeN(H1), ' ', GetTypeN(H2)); END; RUN(SBC_1_Example); HTH, Raymond
  14. MullinRJ

    Connect polyline endpoint to object/symbol

    I just tried it with a Polyline connected to two symbols and the Polyline does not scale when one symbol is moved, like the LINE does; so maybe you can't do exactly what you want. Hopefully you can get by by using a LINE. Raymond
  15. MullinRJ

    Connect polyline endpoint to object/symbol

    Boro, I just tried this for the first time and it seems to work. Use the Constrain Coincident tool to attach one endpoint of a Line to Symbol A and use it again to attach the other end of the Line to Symbol B. Now when you move either Symbol A or Symbol B the endpoints of the Line will move to stay "attached" to each symbol. It works when done manually. I assume it can be scripted. Additionally, if you move the Line, then both symbols will move, too. Good luck, Raymond


7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114


© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.