Jump to content

ccroft

Member
  • Posts

    522
  • Joined

  • Last visited

Everything posted by ccroft

  1. Welcome to the game! I think you should look on this site under support>customization>vectorscript>documentation.Here you will find a downloadable HTML function reference which probably can be printed out in one form or another.It has a couple of ways to view the list. When I'm scripting I usually have it open in a browser window. You'll also find some example scripts in this area that can be illuminating.Vectordepot is another good source of things to examine.Looking at working scripts and understanding (or at least trying to) what's going on is a great way to get started. One thing that helped me a lot (I started with no code writing experience) is an introduction to Pascal. There are some differences between this and v-script,but for understanding basics of arrays,loops and logic it may be helpful.The syntax is pretty much the same.Such books are readily and cheaply available at a decent used book store. The other thing that continues to help me is this forum. See you around.
  2. It seems the Move dialog works(ed) just right in 8.5.2,which is still where I am. The dialog opens with the X axis field active.The next time you open it has the last entered value hi-lited,allowing you to hit enter to accept this value or to enter a new one. Dupe array is pretty much the same.Tab order is Number,X,Y. and it remembers the last settings. The other array options are radio buttons. It's sounds like I'll be wearing out the tab key when I update,which may be later than sooner.
  3. You might also experiment with the snap radius in Prefs.
  4. Tom You need to change the procedure name. The compiler is getting confused by the name being the same as the vectorscript function. The script works if I use for e.g : PROCEDURE scale_it; ..... ..... RUN(scale_it);
  5. Thanks for the offer and the links.I may take you up on that one day.I've been thinking about a strategy for a project that would replace my current cobbled together collection of scripts.Acutally I've been thinking about it for a year or so.....not quite sure which route to go.My current set-up has it's advantages and disadvantages. Oh yeah ,I check the v-script list almost daily thru the web interface.I no longer sub-scribe to the mail though. I've even been so bold as to post once or twice! See you around Charles
  6. Hey Ray Nifty little tester-looper.Thanks for posting this.I think It's the 3rd or 4th time I've learned something about booleans from you over the years Are you..... like.....a real programmer or something? This kind of thinking is hard to come by for the likes of me.
  7. If you only want to work on groups then use FInGroup().It eliminates the need for a test since it ignores things that aren't groups. Also,Group will grab everything that is selected,so you have to be careful.For EG it's a lot harder to make a script that will work on more than one group at a time and return them to their correct consistency. With FInGroup() you can write loops to process as many selected objects as you like. F'n Group....is this an example of developer humour?
  8. Maybe you picked this up already,but I left something out.It should read: symbolHdl:=NextObj(symbolHdl); Sorry bout that. This works for me. If you're still stuck you should post some of your script.
  9. Jeff Thanks for this and your other posts. It gives me a warm fuzzy feeling inside when I see "I hope to address this in a future release." and "Customization Team Manager" in your signature. Charles
  10. I guess this should be in the Vectorscript section..... Anyway,you need a loop and "NextObj". Typically something along these lines: symbolHdl:=FInFolder(subfolderHdl); While symbolHdl<>Nil Do Begin {do something here} symbolHdl:=NextObj; End;
  11. I guess the viewer would have to have the Renderworks (Lightworks) software to be able to render.It would then not be free. Jpeg is the way to go for renderings...small files that everyone can read. The recipient sees exactly what you want them to see right in their mail app.I make jpegs of my renders for mail and also for quick reference. You don't have to open the file or wait for r-works to render out the scene to view it. PDF is the way to go for line art. If you do a lot of this kind of thing you might consider buying the full version of Acrobat,which will allow you to build multipage docs that can contain jpeg,movies or just about anything else.You will have much greater control over the conversion from vworks line art to PDF as well. PDF has been the defacto standard in the print business for years, and it will handle anything you can thow at it beautifully.....IF you are using a professional grade PDF creator and you know how to use it. Unfortunately they're a bit pricy for the occasional user,but you can make files of suitable quality and size for anything from email to art quality magazine.
  12. By way of adding to Peti's reply: There isn't a ready-made solution,so you have to devise it yourself.My strategy has been to design symbols which contain parts that are assigned to classes,and then use worksheets to tally the parts by class and report their sizes. That's where you start.... I have been able to create a system that works for me.I learned a lot about this program along the way.
  13. Alex http://lists.nemetschek.net/archives/vectorscript-l.html It doesn't go back quite as far as Petri's but it's quite useful. Charles
  14. Try searching the archives here: http://lists.nemetschek.net/archives/vectorscript-l.html I've seen a few posts about this,but as yet haven't used it myself. Does your file have ".rsr" suffix?
  15. I'm not sure about the newer versions, but the answer is in resource palette. Find the record there and hit edit.
  16. ccroft

    GetFontID

    It seems that the integer returned by GetFont has something to do with that particular font's position in the list of active fonts. I don't know what you are doing, but you could try something like: TextFont(GetFontID('Arial')); Or you could store the result in a variable: font:= GetFontID('Arial"); and go from there using font instead of a literal. Either way it won't matter what ID is actually returned by GetFont, as long as arial is present in the system. If this doesn't help,you should post back with more info on what exactly you're trying to do with your script.An example of how you are using GetFont would be useful. [ 12-01-2003, 10:24 PM: Message edited by: ccroft ]
  17. You need a vectorscript that will look at the layer scale and adjust the size of your object. A symbol in v-works is always scaled.If you want to work from a symbol, it must be set to convert to group on insertion. As you know, a plug-in can do it. Go to http://www.vectordepot.com/ ,download gMarker plug-in and open the plugin file in a text-editor to see how it's done. Or if you have an older version of vworks you can open one of the marker plugins with create plug-in.
  18. As I understand it (which may or may not be accurate) a script can't be run by simply selecting a tool icon...it requires some interaction with the drawing. It's a tool for drawing. A script like yours that gets it's input only from a dialog should be a menu command. You can assign a key short-cut to it so that no mousing is needed. Hit the key combo, enter the info and hit return or enter (on mac anyway). I have a few such commands. They were simply copied and pasted as you describe, and they behave exactly as they did when they were run from the script palette. You do have some other options to explore in plug-in editor under properties. As to the funcionality of the return key/ok button, I think it's supposed to be automatic with a button who's ID is 1. On mac, this button will also get the familiar look that all "OK" buttons have in all programs. So I guess it's an operating systems thing. Or maybe it's built into DialogEvent(). I think it's beyond our control in v-script. Why your first script didn't work right is beyond me. What's your platform? In any case, you may want to look at "Dialog Builder" under the "tools" section of the v-script area of the main site: http://www.nemetschek.net/support/custom/vscript/vstool.html This has always served me well and creates cross-platform dialogs that work the way I want them to whether they're run as simple scripts,tools,or menu commands. It does create a script with a rather different structure than your first one. Maybe the answer is somewhere in this dif. [ 10-19-2003, 02:23 PM: Message edited by: ccroft ]
  19. What Jim suggests is nice and easy. You would have to enter manually the Status however. This an opportunity for error. If you require a dynamic link between the record and the symbols' appearance you'll need a script. If you have any experience with scripting in any language, it wouldn't be hard to write a script that puts an instance of a symbol into a class for it's graphic attributes, and writes whatever you want to whatever field in the record. I assume you're collecting this info in a worksheet for further processing. This could also be done using a Plug In Oject that has Status as one of it's parameters. In this case the status and the appearance would be seen and changed in a field in the Object Info Palette. [ 10-17-2003, 09:46 PM: Message edited by: ccroft ]
  20. As I understand it, he wants to change visibility of objects based on criteria: like ((t=rectangle)&(C='whatever')). In this way you don't need to click on invisible objects, and the search can be modified to be very specific. The click or option/click is a selector for which branch the script would take, and would be done anywhere on the drawing. If it's a tool, the script won't run by simply getting that tool...you need to do something to the drawing to make it run. I think assigning keys as the selectors (i for invisible and v for visible) will work if the script is a menu command. The best would be a simple toggle, but then you need a way to determine the visibility status of the objects that meet the search criteria. Hide(v=true) would be great...but you need a way to test the objects current status and set v accordingly. I think your suggestion of two scripts, one to show whatever and one to hide whatever, would work well as 2 menu commands with keys assigned as you suggest. I think the ultimate would be a dialog with a choice box for different searches that are used often, a text box for custom searches and a radio button for hide/show. Sound familiar? It's very much like the custom visibility command that comes with the program, but instead of saving the sets of criteria in a palette and running them from there,we have them in a menu command. Maybe the existing solution isn't so bad?
  21. Well...if we did have a function IsVisible:Boolean, then you could use the same logic I'm using. I'm not aware of a way to test the visibility of an object, but there's probably a way. I don't think a script can "know" how it was started,whether from a script pallette or a menu command or with option down or not. It isn't alive until run-time. So I think you would start the script and then look for user input. Maybe mouse-click and option+mouse-click on the drawing. Or the script waits for "v" or "i" key. Or build a dialogue with a radio button for visible/invisible. If you get that working you could have a drop-down with a few different choices of which ojects you wish to change. [ 10-07-2003, 06:12 PM: Message edited by: ccroft ]
  22. Just a thought...if all you're doing is toggling class visibility off and on, you only have to get the current state and change it to the other. I use this in 8.5.2: Procedure front_vis; Var classname:String; Begin classname:=StrDialog('Change Visibility of Class: ','front'); Case GetCvis(classname) of 0:HideClass(classname); -1:ShowClass(classname); 2:HideClass(classname); End; End; Run(front_vis); This invokes a dialog where you can input any class name.The default string 'front' is the one I change the most. If you want a single purpose script get rid of StrDialog and hard code your class there. The drawback is the use of a literal...if you spell the name wrong nothin happens. A dialog with a pop-down of existing classes would be universal. I just haven't gotten around to it cause I'm the only one using this script. There's probably a universal one at VectorDepot.
  23. I insert the symbol from Browser and then run a script to number the symbols. Here's a simple eg: Procedure numbernodes; var num_nodes:INTEGER; Procedure number_the_nodes(hob:HANDLE); Begin num_nodes:=num_nodes+1; SetRField(hob,'readings','node number',Num2Str(0,num_nodes)); End; BEGIN num_nodes:=0; ForEachObject(number_the_nodes,C='nodes'); END; RUN (numbernodes); The "nodes" are numbered in the order in which they are inserted,starting in the bottom layer,from 1 to whatever. If you need a more complex numbering scheme, you have to figure out the logic for that. This is how I did it, but you could write a script that would get a total count of instances of the symbol,insert the symbol and then set the record field to count+1, if you preferred. The end result would be the same. I'm using "class" to find the symbols I'm interested in, but you could also use "name". How you do it is up to you and your needs.
  24. You should also look in the plug-ins section of http://www.vectordepot.com/ And in the add-ons section of this site. "gMarkers" would be relevant I think.
  25. I would have to say there is absolutely nothing wrong with the way fractions are displayed. I make shop drawings for a cabinet shop which works in imperial units to 1/16 inch. Some of the things we build are very complicated and exact, and contain a lot of fractions. Not once has somebody on the shop floor had trouble reading the fractions correctly. VW always puts a space between the whole unit and the fraction. I guess what we're talking about here is more of a graphic design issue. At any rate,if somebody got out a calculator to figure out what 73?4 is,they would be laughed out of the place. When I'm pushing hard,though,I often make this mistake when editing objects in the OI palette, so that instead of 7 3/4" the object mutates to 18 3/4. BTW this is in Canada where in my trade we use both at times. The stacked imperial/metric option is a godsend.
×
×
  • Create New...