Jump to content

James Russell

Member
  • Posts

    399
  • Joined

  • Last visited

Posts posted by James Russell

  1. Maarten,

    Your help has led to something so so helpful to me thankyou. For those of you who are interested in a finished product or for me reading this later when I can't remember what I did:

    Procedure Loop;

    Procedure RotTest(h : HANDLE);

    VAR

    rot :real;

    BEGIN

    rot:= GetSymRot(h);

    If GetRField(h,'Lighting Device','Device Type')='Light' THEN

    BEGIN

    If rot<=0 THEN

    BEGIN

    SetRField(h,'Lighting Device','Use Legend','Legend Rotated');

    ResetObject(h);

    sysbeep;

    End

    ELSE

    BEGIN

    SetRField(h,'Lighting Device','Use Legend','Regular');

    ResetObject(h);

    sysbeep;

    End;

    End;

    END;

    BEGIN

    ForEachObject(RotTest,(R IN ['Lighting Device']));

    END;

    RUN (Loop);

    Mission success! Thanks all!

    J

    Ps. sysbeeps are just for fun!

  2. Thanks Benson and Michael,

    What you've described Michael is a handy layout and approach to viewport management. The feature that I was more looking for would be to merge or add to an existing viewport. I'll alter your list to try and make my idea clearer.

    1. Double click on the viewport tab in the navigation palette

    2. Click the visibilities button in the top right

    3. In the left column select a viewport or saved view

    4. Click copy visibilities

    5. In the left column select all or a range of viewports

    6. Click merge visibilities and have a dialogue which asks if you want to add only, overwrite conflicting values, or solve conflicting errors.

    7. Click OK

    That's kinda my thoughts.

    J

  3. Attempting a script that searches my lighting devices and finds the ones rotated less than 180 degrees and applies my second label legend.

    This is what I have thus far:

    Procedure Loop;

    Procedure RotTest;

    VAR

    h :handle;

    rot :integer;

    BEGIN

    SetSelect(h);

    rot:= GetSymRot(h);

    If rot<180 THEN

    BEGIN

    SetRField(h,'Lighting Device','Use Legend','Legend Rotated');

    End;

    END;

    BEGIN

    ForEachObjectInLayer(RotTest, 2, 0, 4);

    END;

    RUN (Loop);

    I get a Boolean error and I am unsure why. Any advice/better solutions?

    Much appreciated,

    J

  4. Terry,

    I believe you're talking about the print margins set in Page Setup. Go to Page Setup in the File menu and then select Printer Setup. In the Paper Size drop down you can manage sizes and see the border settings for this document. If you have chosen a different page setup or page size this might't occur.

    Hope that's somewhat helpful.

    J

  5. Hey all,

    I was asked a question by a colleague today that I didn't have an answer to and thought you all might.

    If I have a viewport and it has (as an example) 12 layers visible. I then import something from Autocad and this places another 50 layers in my drawing. I go through these layers, turn some on and off and find what I need. Is there a way to merge the active layers and the layers I already have active in my viewport without writing them down and then turning them on/off manually? Over several viewports this could be ridiculously tedious.

    J

  6. Miguel,

    Thanks for your reply.

    I've been playing a bit with this and stripped right back what you've written to what I think is the working bear basics. I've attached my example file for anyone who'd like a look and possible can solve, why this doesn't return a value.

    Procedure Pobj;

    VAR

    objInSym :Handle;

    Pval :Integer;

    BEGIN

    SetActSymbol('1');

    objInSym:= FInSymDef(ActSymDef);

    Pval := Perim(objInSym);

    message(Pval);

    END;

    Run (Pobj);

    Also I'm a little lost on another part of this which is loop lookups.

    The SetActSymbol(*) will eventually for me need to be a lookup for all Lighting Position objects and then take each of the 'Light Position Obj'.'Symbol Name' from them and then the above procedure each of those and save the values into a record attached to the Lighting Position Obj the symbol came from.

    I'll attempt to write a basic layout:

    Criteria=Lighting Device

    First Lighting Device

    Take the Symbol Name of Lighting Device

    Inside this Symbol take the Perimeter of the object

    Save this value to a Record on the Lighting Device

    Next Lighting Device until NIL

    I just don't have the skills to do this kind of lookup loop, if someone could write a semi annotated procedure on this I'd be very appreciative.

    And if you've read this far, thanks.

    J

  7. Also so you all have an idea on where this is heading the lighting positions are track which is generated by a previous script, to be calculated in a linear meterage. We're attempting to have vectorworks calculate totals and round them to meter or 4mt pieces eventually, but just pulling the perimeter value is the first step.

    Cheers,

    J

  8. Hey all,

    Attempting to make a worksheet at the moment, summarising my Lighting Positions.

    Just generated a standard report listing my lighting positions, all good. Each of the lighting positions is made from a polyline, multiple points and a perimeter shown in the object info. Also all good and happy.

    So here's the catch, the worksheet shows the lighting positions, one of the fields has ='light position obj'.'symbol name' returning the symbol name. I then somehow next to this field (preferably) need to have the perimeter value of the line within the symbol mentioned in the previous cell.

    Any ideas?

    Might be able get a script to return the value into a record attached to the object and then reference this but it seems like a long work around and I don't have a way as yet of getting a handle on an object in a symbol.

    J

  9. Thankyou both or your help, the DoMenuTextByName command is awesome, perfect some would say. The only issue I'm having which feels like a bug is when the convert to light position is done, the object becomes unselectable, try the script below if you have spotlight.

    Procedure CustTool;

    VAR

    Name:STRING;

    Result:BOOLEAN;

    BEGIN

    PushAttrs;

    CallTool(-203);

    PopAttrs;

    DoMenuTextByName('Convert to Light Position',0);

    END;

    Run(CustTool);

    It should let you draw a rectangle and then convert it to a light position. I find I cannot select the object only the label handle. When I touch this or nudge the object it returns to normal.

    I tried a Hmove on it by a fraction but to no avail.

    Frustratingly close, does anyone else have this?

    J

  10. Maarten,

    Thankyou, you are correct, twice was the generated output from the custom tool creation script, and the colour was just something I chose from the palette at random.

    I placed:

    DSelectAll;

    h:=PrevObj(PrevObj(LObject));

    SetSelect(h);

    after the Popattrs; and added h:Handle; to the VAR as I thought it should go but once the double polygon is finished being drawn all three polygons are still selected.

    Even if I can just look within these three polygons for the one where pen colour=null and that becomes selected. The Convert to Lighting Position Object could be a manual menu job if necessary.

    I'll keep playing but any input is much appreciated.

    Cheers,

    James

  11. Hi all,

    I'm trying to create a new tool for use in our new template. I've been playing with the create custom tool scripts for a while but I am not able to get the result that I want at the moment.

    Basically I would like a tool that creates a double line polygon with three components, 30mm as the overall width, broken into two fills, a black fill for 20mm and a 10mm fill in red, see attached pic for details on that part. Using the existing custom create a tool I have this script:

    Procedure CustTool;

    VAR

    Name:STRING;

    Result:BOOLEAN;

    BEGIN

    PushAttrs;

    Result := DeleteAllDLComponents;

    Result := InsertNewDLComponent(1, 20, 1, 0, 2, 2, 2);

    Result := SetDLComponentName(1, 'BLACK');

    Result := SetDLComponentClass(1, 0);

    Result := SetDLComponentFillColors(1, 257, 257);

    Result := SetDLComponentPenColors(1, 257, 256, 257, 256);

    Result := SetDLComponentUseFillClassAttr(1, FALSE);

    Result := SetDLComponentUsePenClassAttr(1, FALSE, FALSE);

    Result := InsertNewDLComponent(2, 10, 1, 2, 0, 2, 2);

    Result := SetDLComponentName(2, 'RED');

    Result := SetDLComponentClass(2, 0);

    Result := SetDLComponentFillColors(2, 257, 1251);

    Result := SetDLComponentPenColors(2, 257, 256, 257, 256);

    Result := SetDLComponentUseFillClassAttr(2, FALSE);

    Result := SetDLComponentUsePenClassAttr(2, FALSE, FALSE);

    SetDLSeparation(30);

    SetDLControlOffset(0);

    SetDLOptions(1);

    CallTool(-218);

    CallTool(-218);

    PopAttrs;

    END;

    Run(CustTool);

    This works very well for the first part of my little project. The resultant is 3 polygons (as expected), black, red and white. Now for the tricky part.

    On completion of drawing the polygons I would like it to select the white polygon and convert it into a Lighting Position Object.

    Anyone? It's probably a line like get selected object white convert to lighting position object, but I really don't know the syntax on that.

    Any help much appreciated.

    Cheers,

    James

  12. Dworks,

    Thanks for the tip, I'm playing around with alignment and movement scripts at the moment. Unfortunately it won't help here as we are working with the VAA titleblocks, meaning the alterations would have to occur in the template file, which would alter it for other things and that just causes problems everywhere!

    It would just be nice if you could link spacing of text fields to each other. If the the field expanded or wrapped the items above or below would shift accordingly.

    Grrrr.

    Thanks,

    J

  13. I have two records attached to my lighting devices currently, the standard Light Info Record containing all the regular jazz (Position, Wattage, Lamp Type, etc.) and a Costing Record which I am using for supplier and cost data.

    Inside the symbol I am adding data just the same as I have with the Light Info Record to the costing data. Upon insertion of the lamp the costing data is wiped!

    I can only presume when the script for the on insertion of the lighting device happens it clears all data from the other records.

    Anyone else replicate/solve this?

    Cheers,

    James

  14. Just wondering if anyone might have a solution for this. I'm currently rebuilding out design template at work and wanting to have a series of text fields that will shift according to a previous item.

    In the example attached I have a Project Name, Author and Date fields arranged the way I would prefer them to look for the time being with "-" between them as static text fields. All is well if this was the only text here but if I alter the Project Name to something longer it will, as expected, run over the other fields.

    I was wondering if anyone has solved this problem, possibly with constraints? It would be a nice fix for me.

    Cheers,

    James

  15. Jed,

    The best way that I find to bring images into the 3D environment is to use image props. Just have a look through the help index or a quick youtube search if you haven't used them before.

    Using crossed planes you can make an image appear the same from a front/back and a left/right perspective, or use the rotate to viewer function to make it appear the same from any perspective.

    Hope that helps,

    J

  16. Filemaker is another option we have here, it just would have been nice because a lot of our price lists come in as .xls. I guess I could always convert them across.

    Any ideas why the ODBC doesn't work? Is it functioning at all?

    Cheers,

    J

  17. Hi all,

    So I've downloaded the demo of 2011 to test as an update for our current 2010, mainly for the ODBC options which would increase our productivity like crazy.

    Naturally lept straight in without having set up one of these databases before. Made a few objects with a record with a few fields, opened up excel, make up some data relating to the fields, straight forward logic.

    Now I've hit the wall, open database connection... and then?

    After much forum surfing and browsing many many pages of help I just want someone to say step by step what to do. Do I need MySQL or a magic driver or enable something in my excel document or write a line of code in the ODBC administrator?

    Quite at a loss, might be a big ask for a step by step but even just a link to something useful.

    Cheers,

    James

×
×
  • Create New...