Jump to content

MaxStudio

Member
  • Content Count

    307
  • Joined

  • Last visited

Everything posted by MaxStudio

  1. I have a plugin that creates a door. I'm going to use the same plugin to make new and exisitng doors. I need a check box or pulldown to set the door to New or Existing. If the door is new it is included in the schedule/report... if its existing it is not included in the schedule, but remains a plug-in object on the drawing.
  2. I need to create a check box to include/remove a plugin object, at will, from a report database. Anyone have any references on how to accomplish this? Thank You
  3. ok, but i don't want click to be an invisible parameter that does not show in the OIP. so here's a silly question... how do I retrieve this invisible parameter?
  4. but even if I remove click:=1; from the retrieve parameter section nothing seems to change; the object still does not rotate. if I change click:=1; to click:=2; it draws the rectangle then rotates it 15 degrees, but the button does not do anything. This leads me to believe something is wrong with the way I'm setting or getting the field, or something is coded incorrectly in the CASE theButton OF buttonID_1: section ...
  5. Ok, so in the last example i was able to get the rectangle to grow 12" everytime I clicked the button. In this next example I want the rectangle to rotate. Each time I click the button I want the rotation to be assigned a new value via the CASE OF. What I want to happen: 1. rectangle is created (click is set to 1, rotation set to 0) 2. button pressed (click does not = 4, becomes click + 1, click becomes 2, rotation set to 15) 3. button pressed again (click does not = 4, becomes click + 1, click becomes 3, rotation set to 30) 3. button pressed again (click does not = 4, becomes click + 1, click becomes 4, rotation set to 45) 4. button pressed again (click does = 4, click becomes 1, rotation set to 0) It draws the rectangle, but it's not rotating. I know I'm doing something wrong any ideas on this one? PROCEDURE Example3; CONST kObjOnInitXProperties = 5; kResetEventID = 3; kObjXPropHasUIOverride = 8; kWidgetButton = 12; kObjOnObjectUIButtonHit = 35; buttonID_1 = 1234; {user-definable index} VAR theEvent, theButton :LONGINT; result :BOOLEAN; sourceFieldNumber :INTEGER; buttonEventID :INTEGER; displayString :STRING; thisDoesNothing :LONGINT; x,y,w,h,rotate:REAL; click:LONGINT; f:STRING; H1:HANDLE; result2 :BOOLEAN; objname :STRING; oh,rh,wh :HANDLE; BEGIN { retrieve custom object information } result2:= GetCustomObjectInfo(objname,oh,rh,wh); { if object information was successfully retrieved } IF result2 THEN BEGIN { retrieve parameters } w := Pw; h := Ph; click:=1; f:=Num2Str(0,click); SetRField(oh,objname,'click',f); END; BEGIN vsoGetEventInfo(theEvent, theButton); CASE theEvent OF {User has single-clicked the objects icon.} kObjOnInitXProperties: BEGIN {This tells VW to let the object decide what goes onto the Object Info palette.} result := SetObjPropVS(kObjXPropHasUIOverride, TRUE); {Now we manually add the "normal" parameters...} {One way is to use this single call to add all of the existing parameters.} result := vsoInsertAllParams; {Finally, we add the button.} displayString := 'My Great Button'; result := vsoAppendWidget(kWidgetButton, buttonID_1, displayString, thisDoesNothing); END; {User has clicked a button in the Object Info palette.} kObjOnObjectUIButtonHit: BEGIN CASE theButton OF buttonID_1: BEGIN f:=GetRField(oh,'click',f); click:=Str2Num(f); IF (click=4) THEN BEGIN click:=1; f:=Num2Str(0,click); SetRField(oh,objname,'click',f); END ELSE BEGIN click:=click+1; f:=Num2Str(0,click); SetRField(oh,objname,'click',f); END; ResetObject(oh); SysBeep; END; END; END; {Object reset has been called.} kResetEventID: BEGIN CASE click OF 1: BEGIN rotate:=0; END; 2: BEGIN rotate:=15; END; 3: BEGIN rotate:=30; END; 4: BEGIN rotate:=45; END; END; Rect(x, y, x+w, y+h); H1:=LNewObj; HRotate(H1,x,y,rotate); END; END; END; END; Run(Example3);
  6. Ok, so it draws the rectangle but when i click the button it changes the new width of the rectangle to 12 instead of adding the 12 to the original x. I know i'm doing something wrong just not sure what. PROCEDURE Example3; CONST kObjOnInitXProperties = 5; kResetEventID = 3; kObjXPropHasUIOverride = 8; kWidgetButton = 12; kObjOnObjectUIButtonHit = 35; buttonID_1 = 1234; {user-definable index} VAR theEvent, theButton :LONGINT; result :BOOLEAN; sourceFieldNumber :INTEGER; buttonEventID :INTEGER; displayString :STRING; thisDoesNothing :LONGINT; x,b,d:REAL; a,c:STRING; result2 :BOOLEAN; objname :STRING; oh,rh,wh :HANDLE; BEGIN { retrieve custom object information } result2:= GetCustomObjectInfo(objname,oh,rh,wh); { if object information was successfully retrieved } IF result2 THEN BEGIN { retrieve parameters } x := Px; b:=0; END; BEGIN vsoGetEventInfo(theEvent, theButton); CASE theEvent OF {User has single-clicked the objects icon.} kObjOnInitXProperties: BEGIN {This tells VW to let the object decide what goes onto the Object Info palette.} result := SetObjPropVS(kObjXPropHasUIOverride, TRUE); {Now we manually add the "normal" parameters...} {One way is to use this single call to add all of the existing parameters.} result := vsoInsertAllParams; {Finally, we add the button.} displayString := 'My Great Button'; result := vsoAppendWidget(kWidgetButton, buttonID_1, displayString, thisDoesNothing); END; {User has clicked a button in the Object Info palette.} kObjOnObjectUIButtonHit: BEGIN CASE theButton OF buttonID_1: BEGIN AlrtDialog('Custom Button Dialog'); b:=b+12; a:=Num2StrF(b); SetRField(oh,objname,'x',a); ResetObject(oh); END; END; END; {Object reset has been called.} kResetEventID: BEGIN x:=Px; c:=GetRField(oh,'x',a); b:=Str2Num(c); d:=b+x; Rect(0, 0, d, 1); END; END; END; END; Run(Example3);
  7. Thanks Josh, I'll play around with it. I appreciate the direction. Derek
  8. Using the link you provided and example 3 I was able to get the button to be created. I started doing a few test to see if I could get the square object to change size when the button is clicked. I changed the second x coordinate in the rect (0, 0, 1, 1) to an 'x' variable. x:=1; rect(0,0,x,1) when the button is clicked: x:=x+12; Unfortunately, I'm not having any luck. I'm not sure if i'm putting my variables in the right places. Below is the original code. Any ideas where I should insert the x:=x=12;? PROCEDURE Example3; CONST kObjOnInitXProperties = 5; kResetEventID = 3; kObjXPropHasUIOverride = 8; kWidgetButton = 12; kObjOnObjectUIButtonHit = 35; buttonID_1 = 1234; {user-definable index} VAR theEvent, theButton :LONGINT; result :BOOLEAN; sourceFieldNumber :INTEGER; buttonEventID :INTEGER; displayString :STRING; thisDoesNothing :LONGINT; x:REAL BEGIN { This is where I placed x:=1; } vsoGetEventInfo(theEvent, theButton); CASE theEvent OF {User has single-clicked the objects icon.} kObjOnInitXProperties: BEGIN {This tells VW to let the object decide what goes onto the Object Info palette.} result := SetObjPropVS(kObjXPropHasUIOverride, TRUE); {Now we manually add the "normal" parameters...} {One way is to use this single call to add all of the existing parameters.} result := vsoInsertAllParams; {Finally, we add the button.} displayString := 'My Great Button'; result := vsoAppendWidget(kWidgetButton, buttonID_1, displayString, thisDoesNothing); END; {User has clicked a button in the Object Info palette.} kObjOnObjectUIButtonHit: BEGIN CASE theButton OF buttonID_1: BEGIN AlrtDialog('Custom Button Dialog'); { I thought I could place the x:=x+12; here, but it didn't seem to do anything} END; END; END; {Object reset has been called.} kResetEventID: BEGIN Rect(0, 0, 1, 1); END; END; END; Run(Example3); Any thoughts?
  9. I would like to create a button in the object info pallette that allows me to flip an object exactly how it works with the vectoworks door object. Is this possible? I don't need to the code to make the object flip. I just need to know if there is a way to create the button. I don't think I overlooked it in the parameter list.
  10. Im creating a set of objects with the same plugin. The plugin has a user defined string parameter. Lets say the string parameter is "name" I create object1 and set the name parameter to "Red" I create object2 and attempt to set the name parameter to "Red". I would like it to alert me that "Red" is already in use, give me the option to set it to something else, or allow me to override and continue to use "Red". Is this possible?
  11. Thanks guys! The Database Headers option was exactly what I was looking for.
  12. I've created a report for a plugin object and I'm using it to create a schedule. Is there a way to hide the database row which contains all the formulas? for example... A database row is created at row 5. each plugin gets a row 5.1, 5.2, I want to hide the original row 5 that has the running total and leave all other rows 5.1, 5.2 etc. Is this possible? thank you Derek
  13. 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.
  14. 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?
  15. 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
  16. 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.
  17. 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?
  18. 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);
  19. 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.
  20. 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%.
  21. Hey thanks kevin I found it! Huge help!
  22. 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
  23. 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?
  24. 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?

 

7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114

 

© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.

×
×
  • Create New...