Jump to content

MullinRJ

Member
  • Posts

    1,987
  • Joined

  • Last visited

Everything posted by MullinRJ

  1. To the best of my knowledge, you cannot call custom Menu Commands from within another Menu Command or Plug-In object. If you find a way to do so, please post it. Raymond
  2. Carl, Do you know what font is used in the logo? Have you tried typing it out in that font and converting Type to Polylines? If you get that far, the edits become manageable. Raymond
  3. Carl, 515 vertices is workable, compared to 16K vertices. It's still high, but you're in the right ballpark. Is there any reason you are converting to Polygons? Polylines will extrude. The built in Poly Smoothing functions in VW are inadequate for this task. There are some 3rd party tools. The one that comes to mind is a VectorBits tool - Purge Polygons. Vector Bits - Donationware There are probably others, but you'll have to search the web. HTH, Raymond
  4. Hi Carl, ???The vertex count is WAY too high in the letters to be useful for any extrusion. The capital S alone has 16589 vertices. You will need to reduce the vertex count by 10X to 100X if you want VW to handle these as extrudes with any alacrity. Raymond
  5. Have you tried: CreateDuplicateObject (objectToDuplicate, containerHandle :HANDLE) : HANDLE; ???and ConvertToPolygon (h: HANDLE; resolution: INTEGER) : HANDLE;?? to do the Convert Copy to Polygons? They look promising. Not sure how to do the Cut 3D Section. Raymond
  6. Not directly in VW, but with the Reshaper plug-in, you can. If you'd like to try it, write me offline at info@siriussolutions.net. Raymond
  7. Extrude the 2D Polygons. That will give you 3D objects you can manipulate in position and/or add and subtract. Raymond
  8. Timbo, ???Since no one else has posted I decided to try this. hMoveBackward() does work. Here's an example that creates a new layer with a stock name, numbers it and sends it to the bottom. It can be easily made into a procedure or function that can be called from within a larger script. Raymond PROCEDURE NewLayerOnBottom; { Create a new layer and send it to the bottom of the stacking order. } CONST BLN = 'Layer'; { Base Layer Name } VAR I :Integer; S :String; BEGIN I := 1; while (GetLayerByName(concat(BLN, ' ', I)) <> nil) do I := I + 1; S := concat(BLN, ' ', I); Layer(S); hMoveBackward(GetLayerByName(S), True); END; Run(NewLayerOnBottom);
  9. Does HMoveBackward() work? I haven't tried it, but that would be my first guess. Raymond
  10. Is your profile open or closed? If open, try closing it. If closed, try opening it. Raymond
  11. SetPref(14, not GetPref(14)); Use this one line VectorScript and it will toggle the "show others while in groups" pref. You can run it from a script palette, or do as most of us do: create a Menu Command in the VectorScript PlugIn Editor, and add it to your workspace(s) with a keyboard shortcut. If you need help doing the latter, write back, but you can start by reading Robert Anderson's post The VectorScript Advisor: What do I do with a VectorScript, anyway? Raymond
  12. I've not tested this, but if you know the name of the texture beforehand, GetObject() should return a handle to the resource. Raymond
  13. Don't forget the CONCAT function. If you want to see the value in a string and don't care about the number of decimals, CONCAT is quick and easy. It works on a whole bunch of data types, too. MESSAGE does the same thing including posting the string to the Message Window. These are both great functions for debugging. Raymond
  14. Try: ???PickObject() - for picking the object under the cursor ???GetPickObjectInfo() - same as above, but will also return a handle for an object inside a container, such as a symbol in a wall. Not sure if it will find an object inside a group (from the outside a group), but it's worth a try. ???ForEachObjectAtPoint() - this is a procedural routine that will return all the handles that are under the cursor and allow you to do something with each of them. HTH, Raymond
  15. TextWrangler is just a word processor. Yes, you use $Include in your PIO to reference a text file on disk, which makes debugging your script faster than opening the PIO Script editor each time you want to effect a change. You keep the file open in TextWrangler (or any text based word processor), make a change, save the file to disk and run your PIO again to see the effect of your change. One nice thing about using TextWrangler is that it allows for text coloring of key words in VS by adding a plugin to TW. Orso Schmid posted such a PlugIn to TW with the list of keywords that TextWrangler will recognize when your file extension is .px, .vs, or a few others. You can find it and installation instructions here: http://www.vectorlab.info/index.php?title=VSS_Language_Module_for_BBedit_%26_TextWrangler You will also want to turn the Compiler Mode preference on, so your script gets compiled each time it is run. Tools>Scripts>VS Compiler Mode Raymond
  16. No problem here, but I'm using 2009. I see nothing in your script that would trigger a problem in any version. How are you running your script? From a script palette? Please describe in greater detail. It may have something to do with your OS. Raymond
  17. Hi Charles, ???You can, if you indent your source code with tabs. First, replace all tabs with three option-space (NBS = non-breaking space) characters, select all and copy, then undo (to restore your tabs). You can then paste on the tech-board and your indents remain. If you indent with spaces, it will be a bit trickier. (It appears you indented some of your code this way, just not all of it. I used NBS characters in my pasted code above and in my paragraph indents here.) ???The only issue I have with using arrays, especially static arrays, is that the code is not general enough. It will fail at the 1001'st object (citing yours and Petri's examples.) This is easy to adjust for us programmer types, but there are a lot of people who cringe at thought of modifying a script. ???The use of dynamic arrays can get around the static array limit, but you have to count everything first then declare your array size, and even then you are limited to 32K elements, which should be enough for most everything, but it's still not bullet proof. ???The method I used does not have a well defined upper limit, but speed may be the limiting factor for it. Remove the italicized lines and it will run faster, but then the replaced objects will be on the bottom of the stacking order instead of on the top. This may or may not be an issue. Tagging everything with a record for reselection is another way to tackle this problem, but it's also cumbersome to write and debug. ???The best part of this thread is there are four examples (actually five with Pat's two posts) of the same idea that a beginning scripter can compare. Happy scripting, y'all. Raymond
  18. So, how long is easy-as-pie? My guess is 2+ hours. OK, this appeared easier that it was, but with a little bit of effort, you can have your cake ? I mean pie ? and eat it, too. I think Petri's suggestion of using an array would have been easier, but we hates arrayssss. Raymond Procedure ReplaceWithSymbol; {Replaces every selected object with the active symbol definition} {Displays a message if no symbol definition is active.} {November 17, 2008} {? 2008, Coviana, Inc - Pat Stanford pat@coviana.com} {Licensed under the GNU Lesser General Public License} {February 26, 2009} {modified to select all symbols of the type used in the replace} {February 27, 2009 - RJM} {Move new symbols to back, so they stay selected.} {Uses HCenter to place symbol at center of selected object.} {Optionally, move symbols to front, so they keep relative stacking order.} Const ???SQ = chr(39);??????{ Single Quote } Var ???H, Hfo : Handle; ???X1, Y1 : Real; ???S1 : String; ???Procedure ReplaceObject(H1:Handle); ???Begin ??????HCenter(H1, X1, Y1); ??????Symbol(S1, X1, Y1, 0); ??????HMoveBackward(LNewObj, True);????????????{ move to back instead of deselect } ??????DelObject(H1); ???End;??????{ ReplaceObject } Begin ???if (ActSymDef <> nil) then begin ??????Hfo := FActLayer;??????????????????????????????{ handle to first object on layer } ??????if Selected(Hfo) then Hfo := nil; ??????S1 := GetSDName(ActSymDef); ??????ForEachObject(ReplaceObject, SEL); ??????{ omit the following if stacking order is not important, } ??????{ otherwise this moves all new symbols to the front. } ??????if (FSActLayer <> nil) then begin????????????{ there were selected objects converted } ?????????if (Hfo = nil) then Hfo := NextDObj(FActLayer);???{ first deselected obj } ?????????if (Hfo = nil) then Hfo := LActLayer;??????{ top selected symbol } ?????????H := PrevObj(Hfo); ?????????while (H <> nil) do begin ????????????HMoveForward(H, True); ????????????H := PrevObj(Hfo); ?????????end;??????{ while } ??????end;??????{ if (FSActLayer <> nil) } ???end ???else Message('No Symbol Definition Selected.'); End; Run(ReplaceWithSymbol);
  19. Assembly, ???Have you tested that "hobject" has a non-NIL value after CreateCustomObjectN() is executed? Your code gets executed several times when it is first placed. The order of events is very cryptic, to say the least. Tracking down when things happen is almost fun. ???Next question; on the line before Reset() you have: ??????SetRField(hobject, objectname, 'framedepth', 'width'); Shouldn't WIDTH be unquoted, as it is in all the other SetRField statements? Raymond
  20. Are you sure the script has stopped running? If the script is still running then nothing will work. Do menu selections work? If not, try hitting Cmd-period several times to interrupt the script, assuming it's still active. If the script really has quit, then you'll have to provide more information. Raymond
  21. One small thing to consider, and I mean very small; if the accuracy of the circle's placement is critical, then the above script is only exact if there are an even number of points on the polyline, and they are equally spaced around the perimeter of the circle. If there are an odd number of points, or the spacing in non-uniform, then the accuracy of the center placement and the radius goes down as the point count goes down. For a large number of points the error is quite small. If the accuracy of the radius is critical, then the above script is only exact when there are polyline points on the 0?, 90?, 180??and 270? points of the circle. With an odd number of evenly spaced poly points, these criteria can never be met exactly. For what you are doing, this is most likely not a consideration, but I state it for others who may want use the script in the future. Raymond
  22. Carpenter1234, Have you solved your problem yet? If not, email me offline and I'll tell you what I've got. Raymond (mullinrj @ aol . com)
  23. MullinRJ

    Bolts

    Hi Andrew, Ignore all of the " Tom was just bracketing his text, but he left out the ; The text you are changing is in an $Include file, so it is part of a larger VectorScript and each line must end in a semi-colon. All Pascal rules apply. The terms kSeriesDIN and kSeriesISO are the names of constants that some other script (the Bolt PIO) is using. Long story short, your file should have the following two lines (in either order) when you are done editing: kSeriesISO = 3; kSeriesDIN = 4; Raymond
×
×
  • Create New...