MaxStudio
-
Posts
319 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Articles
Marionette
Store
Posts posted by MaxStudio
-
-
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?
-
Every so often my object info panel stops displaying object information.
I usually have to restart vectorworks to fix the problem.
Does anyone know of another fix or script I can use to reset or fix the problem?
Thank You
-
i got it working. I believe it was something as simple as not hitting return after my final line of code.
Thanks for your help.
-
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?
-
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);
-
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.
-
one more question. Does it only export the pdf's at full size? Is there a way to export a half size? Normally i don't export pdf's i usually print them. So if i need a half size i simply set the paper size to half and print at 50%.
-
Hey thanks kevin I found it! Huge help!
-
I'm looking to create a script that will print all my "saved views" as PDF's in one step. Is it possible and does anyone know where I can begin?
Thanks
Derek
-
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?
-
is it possible to access an external worksheet, such as an excel file, rather than a worksheet in vectorworks? If so, is it possible to have two separate files access the same worksheet?
-
Thanks Josh I was able to get it to work with your suggestion!
-
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
-
Pat,
I found an old thread you posted:
http://techboard.vectorworks.net/ubbthreads.php?ubb=showflat&Number=112259
I created my plugin object and ran the script. It gave me the list and I used the information generated by your script to better understand what was going on.
I was able to get information exchanged between the plugin object and the worksheet.
thank you
Derek
-
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
-
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
-
Miguel,
I found it! I'm so use to working in the external editor because eveything is color coded and I found it to be easier. The criteria menu is definitely going to be useful in the future.
Thanks
Derek
-
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
-
Pat,
I really appreciate your example. I'll give it a try and let you know how it turns out.
Thank You
Derek
-
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?
-
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....
-
btw i'm trying to to select a specific font but I only want to select the font if it has bold checked. Is that possible?
-
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
-
ok i think i got it working now....
it was as simple as adding two more parentheses
SelectObj((LW=n));
If a parameter value of a PIO is invalid how would you alert the user?
in Vectorscript
Posted
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.