Jump to content

Julian Carr

Distributor
  • Posts

    320
  • Joined

  • Last visited

Posts posted by Julian Carr

  1. It works for me Sam and definitely needs to be in the kObjOnInitXProperties event (5). It's possible it also needs this:

     

    CONST

        kObjXPropAcceptStates = 18;

     

        gFlag := SetObjPropVS(kObjXPropAcceptStates, TRUE); 

     

    Also have you tried quitting and restarting Vw? I find this necessary sometimes even in developer mode.

  2. CONST
       kObjXPropShowPrefDialogWhen = 32;
        kCustomObjectPrefNever      = 0;
        kCustomObjectPrefAlways      = 1;
        kCustomObjectPrefNew         = 2;

     

    blah blah blah...

     

    in event loop 5:

        gFlag := SetObjPropCharVS(kObjXPropShowPrefDialogWhen, Chr(kCustomObjectPrefNever));

     

  3. Wall styles don't typically define wall heights. Rather they define what is used to control the wall or components heights (layer wall height, storey level, etc), as well as having an offset. And of course walls don't have to be level on the top or bottom, and can also be controlled by slabs and roofs, making the task even more fraught. But if you really want to delve into it, then look in the Function Reference in the Objects - Architectural section, for things like SetComponentWallTopOffset().

  4. It's conceivable but would be messy, and could also be problematic if there were so many hatches that the dialogue was too large to fit on the screen. Normally you would would use a list browser for something like this, which would see scroll bars appear if the list was longer than the size of the list browser.

  5. You must specify units when nominating a size in a script, so this line:

     

    RegularPolygon(Px,Py,12,6,1);

     

    should be something like:

     

    RegularPolygon(Px,Py,12",6,1);

     

    or

     

    RegularPolygon(Px,Py,12mm,6,1);

  6. A couple of things to note:

     

    1. You need to set the 3 levels of detail for each object as there is no assumption that if an object is visible at one level, it will automatically be visible at another.

     

    2. If the PIO contains groups, you need to set the detail level for each object within the group as setting it for the group itself will have no effect.

  7. This might be quicker. Convert a copy to nurbs then get its length using HLength():

     

    Procedure T;
    VAR
        hTemp, h3DPoly : HANDLE;
    BEGIN
        h3DPoly := FSActLayer;
        hTemp := ConvertToNURBS(h3DPoly, True);
        Message('3D Poly Length: ', HLength(hTemp));
        DelObject(hTemp);
    END;
    Run(T);

    • Like 1
  8. Then you have to consider how the symbols are constructed. Are there container objects within that you need to traverse such as Groups, or PIOs that are controlling fill attributes of objects within independently? Then you will also need to check whether any of the objects have their attributes being controlled by class and respond accordingly. So all in all, not a simple task.

  9. You need to add a symbol instance to the profile group of the PIO using SetCustomObjectProfileGroup(). Because this is persistent between regens, you need to delete the profile group on each regen then reinstate it. Something like this:


                Symbol('mysymbol', 0, 0, 0);
                h1 := LNewObject;
                h2 := GetCustomObjectProfileGroup(ghParm);
                IF h2 <> Nil THEN DelObject(h2);
                IF h1 = NIL THEN Flag := SetCustomObjectProfileGroup(ghParm, h2)

     

    You can always check the existence of the profile group by selecting your object then using the Edit Group command.

    • Like 2
  10. Sorry you will need to put a minus in front of Name2Index, but also note that you may not see the line is dashed because the line from the adjoining component is solid, so you might need to do something like this:

     

    procedure test;
    var Response : boolean;
    begin
    Response := DeleteAllComponents (nil);
    Response := InsertNewComponentN (nil, 1,  5, 0, 10,  0, 0, 2);
    Response := InsertNewComponentN (nil, 2, 20, 0,  6, 10, -Name2Index('Dash Style-2'), 0);
    SetTool (13);
    end;
    Run (test); 

  11. So what Josh is referring to is a structure like this, which is one of the most time saving scripts you can have because it can be adapted to do so many things::

     

    Procedure TimeSaver;

     

    Procedure DoIt(h1 : HANDLE);

    BEGIN

    SetClass( h1, ‘Class Name’ );

    END;

     

    BEGIN

    ForEachObject(DoIt, (Sel = True));

    END;

    Run(TimeSaver);

     

  12. You might be able to do it in the reset evert (3) using this:

     

    Flag := vsoStateGetParamChng(ghParm, gOutWidgID, gn, gsOldParmValue);

     

    gOutWidgID is the widget ID of the param that has changed.

    gsOldParmValue is the previous parameter value.

     

    I've never used it with control points though, so good luck.

×
×
  • Create New...