Jump to content

ccroft

Member
  • Posts

    522
  • Joined

  • Last visited

Posts posted by ccroft

  1. Thought I'd add a comment for those learning vScript:

    Pat's script demonstrates how to overcome a common problem that we all run up against at some point, and that is how do we apply a function that operates on selection status to individual objects in a selection set:

    Load the selected object's handles into an array (A1). This serves as the list of objects that the user wants to work on.

    De-select the objects.

    Step thru the array, getting each individual object handle, selecting, applying the function (scale) and deselecting before moving on to the next handle in the array.

    Sometimes it's useful to go thru the array one more time at the end to re-select the objects in the list. This allows the user to "try again" on the same set of objects without having to select those objects again.

    This technique is also useful when using some MenuText calls that can only operate on one object at a time. Edit Group/Exit Group come to mind.

    Keep on Scripting!

    Charles Croft

  2. I wish we could attach .vsm, .vst and .vso plugin files to messages in the Vectorscript Resource Share. Despite the fact that File Manager thinks we can, at least 4 users have tried unsuccessfully to date. I've tried 3 times myself.

    This area will slowly atrophy unless this prob can be fixed. The idea is to be able to share complete and fully formed tools

    Charles Croft

  3. The feature matrix (if you can find it) is a headache.

    Here is a list of things missing from Fundamentals that have almost nothing to do with Architecture. You can thank Mike M Oz for this:

    - Navigation palette

    - New Colour palettes

    - Sketch

    - Plan Rotation

    - Section Viewports

    - Design Layer Viewports

    - Viewport resolution control

    - True File Referencing

    - Improved library management

    - Two Way Worksheets

    - Global object editing by criteria

    - IFC import and export

    - Sketchup 6 import and export

    - Batch Print

    - Issue Manager

    - Import/Export PDF

    - Batch Export PDF

    - Import/Export 3DS

    - Stacked Layers

    - Stacked Layer view saving

    - Wall Styles

    - Classable wall components

    - Show wall components in section views

    - Hide Wall Components

    For my money Architect is worth it just for batch print, plan rotation and 2-way worksheets. All very useful in 2d work.

    HTH

    Charles

  4. PIO_name := GetName(GetRecord(fsactlayer,NumRecords(fsactlayer)));

    Interesting bit of wisdom here. I was wondering why NumRecords for the GetRecord index so I played with this one a bit. One works fine....as long as there aren't any other records besides the parameter record attached to the PIO.

    Sooo...the parameter record, it turns out, is always the last one in the list of records attached to a PIO, so if there's 2 others attached, NumRecords returns 3 and that's the index for the record that returns the PIO name. Obvious to some I guess, but not me.

    Thanks Robert,

    Charles

  5. The only part of the explanation that doesn't quite add up that I could see:

    " I make the Drawer-Faces class active, and no objects appear."

    Objects in the active class should be visible, regardless of the visibility setting.

    You might think of the whole thing like this: The container's class INvisibility trumps the class visibility settings of the objects within, and the active class setting trumps all.

    " I think I would rather the grouped objects take on the visibility of the group's class. Yet when ungrouped, they revert to their proper class."

    So you would like Drawer-Bottom to be visible even if it's set to invisible IF the group's class is set visible? It don't work like that. The opposite is true: if the group's class is invisible, the group is invisible regardless of class settings for objects within. Unless the group's class is active.

    Maybe you're getting confused by the active class thing. If you set Drawer-Boxes to invisible and you make that the active class, your group will be visible. It will disappear when you change to a different active class.

    I generally don't change active class, but draw in "None" and assign classes in Object Info. Not that this is the "right" way, but it does make visibility a bit easier to manage for me. All objects disappear if their class is set invisible. Also, when I start changing active classes I have to remember to change back when I want to draw objects in a different class.

    I'm not sure if this is helpful, but remember the class options settings under Organize. You could set that to active class only.

    You might consider grouping each drawer assembly separately. You could edit any one of them without seeing the others if "Show Other Objects While in Groups" pref is unchecked.

    Charles

  6. Maybe a little clarification is needed.

    You have a group in the class 'cabinet'.

    It contains objects in 'fronts' and 'pulls'.

    If cabinet is off you don't see fronts and pulls even if they're on.

    If cabinet is on you don't see fronts and pulls if they're off.

    So you don't see everything unless all 3 classes are on.

    That's how it works way back here in 11. If you're seeing behavior different than this maybe you can explain more clearly.

    Charles

  7. This seems like a good place to post a valuable bit of advice I got from a programmer friend when I was starting. It's a good idea to give your variables,constants and procedures clearly descriptive names.

    When I started I had the false notion that shorter names would somehow be more efficient, possibly because it means less typing. A few extra keystrokes are pretty insignificant to writing and running the script, but can make it far easier to understand and maintain.

    Example: I'm currently re-working something I wrote years ago. I'm looking at things like 'wrknit' and scratching my head. What is that? What does it do? Two more keystrokes and I would've had 'WorkUnit' and that section would read like a book.

    Another comment for beginners: It may not be obvious what the characters { } do in Petri's example above (and elsewhere). These make the words enclosed by them invisible to the vectorscript compiler. Without them all kinds of errors would be generated. Some of us use them to add 'comments' into the script to help make it clear what the different lines and sections are supposed to be doing.

    They are also used to "comment out" sections or lines of code that seem to be behaving badly, or producing un-intended behavior. Then you can see what happens if that stuff is gone. It's one of the basic tools of de-bugging and script development, along with "messaging out".

    And what is messaging out? In re-working my script I may want to verify that WorkUnit is carrying the data it should after it goes thru some math in the script. If I place Message(WorkUnit) at the appropriate spot or spots, a message will appear on screen displaying that value. After I'm satisfied I delete that bit.

    Later

    Charles Croft

    • Like 2
  8. Thought it might be interesting to show how functionality can be tailored to individual needs. I use this tool mostly for hiding objects that overlay other objects that I need to edit. As such it's a temporary view change, and I wanted a simple way to restore my default view of all classes on. Clicking on open space does that.

    Compare this to the one posted by Jonathan below. It doesn't matter to me if I click on "None" so there's no Alert Dialogue warning. I also want to be able to turn off whole groups, so there's no testing for object types with branching to other actions like entering a group. That's the "DoMenuText" part and the attending selection calls in his. He has different needs that his tool is designed to address.

    This simple script also shows the use of a function that returns a value (GetClass) directly in a statement as a value, without assigning that value to a variable. Not a big deal, but sometimes it's a nice way to go.

    Procedure classWork;

    Var

    pickit :Handle;

    x,y :Real;

    Procedure ShowAllClass;

    Var

    i: integer;

    Begin

    FOR i:=1 to ClassNum DO

    ShowClass(ClassList(i));

    End;

    Begin

    GetPt(x,y);

    pickit:=PickObject(x,y);

    IF pickit=NIL THEN ShowAllClass

    ELSE HideClass(GetClass(pickit));

    End;

    Run(classWork);

    Please notice the homage to Wilson Pickett :-)

    I'd like to take this opportunity to say that I think this new forum is a great idea and I will be posting more. Unfortunately, most of mine are tailored to a very narrow purpose, and do nothing without the symbols they are designed to modify. Totally useless to the general population.

    Also, it would seem that long (and sometimes not so clearly written) scripts may not be of much value posted in this tiny window. I find the scroll view that Robert switched to hard to read, as I can't see enough of the script at once.

    Tried adding the "fully formed" tool with File Manager, but despite the fact that the plugin is .vst, file manager ran into a problem with it. I assume it's the same with .vso. This should be fixed so that object scripts can be shared without users having to recreate the parameter list. Posting .vso's here seems a bit pointless if people can't easily try them in a drawing.

    Carry on,

    Charles Croft

    Just found out why the scroll window after pre-viewing this: all the indent formatting of my pasted script is gone. I do follow that protocol as it does indeed make more complicated scripts a lot easier to follow, and re-write as needed down the road.

  9. Bruno

    To begin understanding vScript, I suggest that you go to the Vectorscript Reference in Help and look up FSACTLAYER, GETBBOX,SETBBOX,NEXTSOBJ and HCENTER, and see if you can begin to understand how the scripts that Petri has so generously provided do their magic. The reference is a list of pre-made functions that we weave together to get the work done. This is the basic "vocabulary".

    You'll also need to spend some time with the Vectorscript Guide, also in Help. This explains the structure that the functions need to be set within, and a few other concepts. Generally speaking, this is the "grammar".

    If and when the examples provided here by the Hellion of Helsinki start to make some sense, head over to Vector Depot and download a few Plug-Ins and puzzle over them for a while. There are more examples on NNA's main site under Support>Customization. You may want to stick with Tools and Menu Commands for the moment, as they're generally a little easier to follow than Objects.

    Welcome to Vectorscript for Dummies. (or should that read by Dummies? :-)

    Charles

  10. I don't think a universal window PIO is possible. Check that...it's possible but it would be a major undertaking. InteriorCad has produced the closest thing I've seen to a universal cabinet PIO, but it costs about the same as Fundamentals.

    This is an inherent problem with parametrically controlled objects. At a certain point it becomes necessary to actually draw what you want, even with InteriorCad.

    Terminology: Is it WallBoard,SheetRock,DryWall or Gypsum Board? All of these are standard names in different parts of North America alone. And let's not forget that there's not even consensus here on these boards as to what "None" means.

    There are limits to what software can do and there always will be. Many of these limits are outside the scope of software design. Localisation is the answer. Who's responsibility is the question.

  11. Thanks for posting this Gerard. 96% success rate is very encouraging.

    Don't know if I can say the same for this part though:

    BTW, I love VW 2008. It is quite stable, as long as you are not scripting.

    Maybe I'll start cleaning up some of the older more disorganized stuff now to make it easier to trouble-shoot come upgrade time. I think they call it 'refactoring': organizing for easier maintenance. My early stuff is really hard to follow.

  12. Thanks for dropping by!

    Well...I've been trying to boil those questions down in my responses to Petri's probs, but that's about as far as I've been able to get. It makes me paranoid when people say their stuff works in 12 but not 13.

    I did post this a while back to try and see if the problems he's having are more widespread. Fact is, if there were such fundamental and fatal flaws, this forum and the mail list would be burning up. Been pretty quiet over there.

    Later

    c

  13. Not a wall and door kind of guy, but it seems that Gerard's script would work.

    I believe a wall is a parent/container. You get a handle to that with FSact even though the wall itself isn't selected. You get a handle to the first object in the wall with Fin3D. If this object is not selected you move on to the first selected object with NextSObj.

    Just ignore the fact that the PIO appears selected in the drawing while the wall itself does not. You already know how to get the handle to the wall.

    Or maybe you can use ForEachInList or a While loop to traverse the objects in the wall until you find the correct one.

    You could use properties to prohibit multiple selection and make the find easier (with appropriate help strings).

  14. Just wanted to point out that lots of people are having font issues in other programs after installing Leopard. That is to say it's not unique to Vectorworks. There are some fundamental differences in the way Leopard handles fonts compared to Tiger, and some suggestion that it is "pickier" about older font versions.

    Unfortunately I don't have any real information to help Mikey, except to ask if he's tried verifying it through Font Book. And while there check that the Postscript Type 1 files are present. Mail may be using a TrueType version?

  15. I think you guys know this but I'll say it anyway for the benefit of any neophytes that might happen by:

    Strange behaviour in PIO's that is mysteriously fixed by restart can be related to "vectorscript caching". In the industry series you have a menu command somewhere to turn this off and on. Fundamentals users like myself use something like:SetPref(407, NOT GetPref(407));

    Turning it off forces compilation of the script on every run. With caching on you may not see the result of script changes on subsequent runs. Especially when using includes.

    (I believe a carriage return happens when the cabbie returns to the stable.)

  16. Hmmm...2 way worksheets. Hadn't thought of using the feature like that, Pat. Opens up a whole host of possibilities. I guess he could also use a "Spare" feild in the existing record in much the same way.

    I wonder if I could hi-jack this thread a bit and ask you a couple questions about the new worksheets. I need a bit of ammunition to fight for the upgrade to 2008 and Industry series.

    What happens if you have more than one object summed in a sub-row. If you make a change to one worksheet field I guess it changes that field in all the objects records?

    And what happens if you use the "force-select" (or whatever it's called) in this situation. My understanding is that if there's one object, it'll take you to the layer the object is on and select it. If you have more than one object what happens? Can you tab or something to each object?

    TIA

    Charles

×
×
  • Create New...