Jump to content

MaxStudio

Member
  • Posts

    319
  • Joined

  • Last visited

Posts posted by MaxStudio

  1. I created a separate file the is referenced as a test for all values. I test the value.. if it it's below 0 i use and AlertInform(); then set the parameter to the minimum value. It draws the object using the minimum value but alerts the user that they input an invalid number. If the parameter is a dimension I tried using an ABS to convert the negative value to an absolute instead of inserting a minimum value.

  2. I have a script that creates a plugin object that accepts a parameter, call it "ParamA". ParamA is an integer. The script creates a rectangle, duplicates it and offsets it a specified distance.

    I use a repeat/until to repeat the procedure "ParamA" number of times.

    My problem is this. If the user sets ParamA to 0 the plugin crashes.

    I know I can test the parameter early on in the script using:

    If ParamA>=0 Then BEGIN

    {my script}

    END

    ELSE BEGIN

    END;

    But I'm curious to know what the best practice is when it comes to a situation like this? I don't want my scripts to crash, but I also don't want the user to sit there and wonder why nothing is happening. Should I use a dialog to explain to the user what went wrong? Or is there a way to highlight the parameter in the Object Info Pallatte? How do you handle this situation?

  3. Thanks guys I was able to get it to work.

    Now I'm trying to get more than one calculation to display but it is not allowing me do it.

    currently I have the following:

    widthstring:=Num2StrF(w);

    SetRField(oh,objname,'Width',widthstring);

    heightstring:=Num2StrF(h);

    SetRField(oh,objname,'Height',heightstring);

    Both static parameters show up in the OIP, but only one (the first one) displays the calculation. Any idea why? Do I need to have a separate handle and or object name for each?

  4. Ok this is what I have and it works. The only problem is it is displaying the results in the OIP in inches... is there a way to get it to display as feet and inches...

    ex: the rectangle is 3'-0" wide x 2'-0 high, the width is displaying as 36.00 and the area displays as 864.00

    I would like to have it display as width 3'-0" and area as 6 sq ft.

    do i have to do the math and break it down using a concat?

    Thanks

    PROCEDURE plugin;

    VAR

    x, y, w, h, area : REAL;

    widthdisplay, areadisplay: STRING;

    result : BOOLEAN;

    objname : STRING;

    oh,rh,wh : HANDLE;

    BEGIN

    { retrieve custom object information }

    result:= GetCustomObjectInfo(objname,oh,rh,wh);

    { if object information was successfully retrieved }

    IF result THEN BEGIN

    { retrieve parameters }

    w := PW;

    h := PH;

    rect(x,y,x+w,y+h);

    area:=w*h;

    widthdisplay:=Num2Str(2,w);

    areadisplay:=Num2Str(2,area);

    SetRField(oh,objname,'Width',widthdisplay);

    SetRField(oh,objname,'Area',areadisplay);

    END;

    END;

    Run(plugin);

  5. I have a Plug In Object. When I select the Plug In Object I would like to see calculations (such as Area) displayed in the Object Info Palette.

    Much like how it displays "Area" & "Perimeter" when a person creates a rectangle.

    Does anyone know how to make this happen? I already have variables and the calculations. I just need to know how to have it displayed in the OIP.

    I will further investigate. Thank You.

  6. What I'm trying to do is link two drawing files. A plan file and an interior elevation file. Both are drawn in 2d using the plugin objects created. Im trying to figure out if there is a way to have one worksheet that would allow me to interact with both file simultaneously.

    Is it possible to xref a worksheet from one file to another?

  7. I created a plugin object that creates a geometric shape and uses strings to display some text. Unfortunately, if I rotate the plugin object in vectorworks the text rotates as well. This creates major neck cramp issues. Is there a way for me to script the rotation of my text so when I rotate my plugin object my text adjusts itself to always displayed correctly?

    Thanks in advance,

    Derek

  8. Pat,

    Thanks. By creating a database do you mean a "record format"?

    When i click on the data tab of my plugin object it only lists a "record format" which is currently linked to my title block. Should I create another one for the plugin object?

    Derek

  9. Anyone have a simple example of a plugin object that adds or changes info on a worksheet?

    Im trying to do the following:

    Create a plugin object with some sort of label.

    Add that label to the worksheet.

    List the variables (width, height) of the plugin on the worksheet.

    If I change the width of the plugin object I would like it to change on the worksheet too.

    Is this possible? Any simple examples that might be a good place for me to start?

    Thanks

    Derek

  10. Thanks Pat it worked exactly as I needed it to.

    I'm switching from not using Quartz Imaging to using Quartz Imaging and it is messing with some of my fonts. This is going to make it a lot easier for me to fix some of my older drawings.

    I appreciate it.

    Derek

  11. But how would I script that?

    ForEachObj(font, ?????)?

    i'm not sure how to correctly script the criteria....

    Why don't you use the "Criteria" menu in the script editor to build the string? This is the same dialog used for building the selection criteria.

    Most likely, most of us old scripters use an external editor so we forget about this feature found in the vs editor.

    I use TextWrangler. I'm using VW2008 is this feature in this version of the script editor?

  12. If you really need to select by Bold, I would use ForEachObject with a either the specific font or all text in general as the criteria. The callback procedure would then check to see if the font is bold and select it if it is.

    But how would I script that?

    ForEachObj(font, ?????)?

    i'm not sure how to correctly script the criteria....

  13. If I want to use SelectObj to select a font I can use the following:

    SelectObj(FOT='name of the font');

    If I want to use SelectObj to select a line weight I can use the following:

    SelectObj(LW=4);

    I've gotten this information from posting in the forums.

    My question, is there an appendix or some place I can go online to understand the criteria? Why is it 'FOT' for font? why is it 'LW' for line weight?

    Thanks

    Derek

×
×
  • Create New...