Jump to content

Mike Rock

Member
  • Posts

    36
  • Joined

  • Last visited

Reputation

9 Neutral

Personal Information

  • Location
    United States

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. You need to provide the value for if the IF statement was false. It will go between the last comma and ) In the formula I supplied I used an empty string ' ' You could also put some text there. To learn more with the worksheet open click Insert>Function and select If and it will tell you how to structure the formula.
  2. Try this formula in C2 '=IF(('BrxHoist'.'OriginX'<=0), 'BrxHoist'.'OriginX', ' ')' As for your Y values not sorting correctly it looks like you might be using Origin y (formatted) try changing that to Origin Y.
  3. I can be more clever... I inserted column B and put '=IF((C2<0),SR,SL)' in cell B2, that assigned each point to SR or SL without taking up the position field on the record. The edge case for points on the center line getting assigned to SL doesn't seem too bad for the ease of implementation...
  4. One way to achieve this would be to sort by a 2nd value. I filled in the Position field with SL, C, or SR to allow me to do all the points on center first, then all the SL points in order according to the origin Y value, I didn't bother but in theory you could filter the Origin X row to make sure you have the point closest to center first. Notice the small 1 under the filter arrow for position and the small 2 under the Origin Y filter. this tells you in what order the filtering is applied. Someone a little more clever might have another solution...
  5. Were you able to solve this issue? I'm having the same problem with the Popup being blank after selecting an entry. I've included "result := SetObjPropVS(53, TRUE);" in the case for kObjOnInitXProperties:
  6. As Mark said - Spotlight numbering could save you some trouble. I made a simple 12 X 12 grid of chairs and was able to get the tool to number them pretty quickly. Using letters for rows and then running the tool again using numbers for the seat number. Now if your arena is like most and some sections have uneven row lengths the spotlight numbering tool won't be able to easily account for those edge cases.
  7. Thanks folks - the code on the VS side is a single line '{include...' Saving the Notepad ++ file and recompiling the script is very helpful, now I can take advantage of more features of notepad ++ like bookmarks.
  8. @BillW Thanks for taking the time to create, document, and share this, I've been using it for the last couple weeks and found it very helpful. A (possibly) silly question - is there a better work flow than copying and pasting the code back and forth between VW and Notepad ++? Using the Text File option in the script editor pulls it once but my ideal workflow would to be able to have the code refreshed each time the editor is open. Any suggestions to be able to quickly push the code from Notepad ++ to VW?
  9. I'm hoping to use the floating data bar to display some information during a script. Currently I have the data being displayed with Message(); but I'd prefer it to be front and center where the work is being done. I'm hoping to achieve something like the Spotlight Numbering Tool has. I've searched this form and the VS:Function Ref but can't find anything to lead me to a floating data bar. Is the floating data bar something that can be implemented with a vectorscript? If so I'd love a hint...
  10. Could you share a picture of what the goal looks like? maybe one you have done in auto cad?
  11. I haven't jumped into the data tag pool, could you clarify your workflow a bit for me? While you annotate the viewport do you have to click on each motor in the plot and then manually arrange the data tag into the grid?
  12. Thanks @Jesse Cogswell - that was the solution and explanation I was hoping for.
  13. Hi @MullinRJ Thanks for cleaning up the code. I had to change the line SetFillback(h, r, g, b); to SetFillback(PIOHand, r, g, b); to reflect the new handle name used in your update. After that the code ran correctly. However it still requires the setclass line to work as intended. I can move to after the setfill line and it still works. If I comment it out completely I'm back the earlier issue of the color changing in the attribute palette for the rectangle but the rectangle color doesn't update until some action (clicking on solid fill, changing the line weight, manually assigning it to a new class) (What doesn't work - -changing views, moving or rotating the object) 'pushes' the new color to it. For now I'm happy to keep the setclass line in there as a work around if the proper solution isn't apparent. If the issue is tied to something bigger I'll cross that bridge when I come to it. Thanks again. Mike
  14. Here is the rest of code, for the 'real' script I do want to set to object to a specific class so I can use the code as is. I was just trying to understand what effect the setclass call was having on the code to make it work... 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,dialog1 :INTEGER; buttonEventID, color :INTEGER; displayString :STRING; thisDoesNothing, r, g, b :LONGINT; H :Handle; FUNCTION ColorPopUp :Integer; VAR dialog1, result :INTEGER; PROCEDURE Dialog_Handler(VAR item :LONGINT; data :LONGINT); BEGIN CASE item OF SetupDialogC: BEGIN SetColorChoice(dialog1, 4, 1242); END; 1: BEGIN GetColorChoice(dialog1, 4, result); ColorPopUp := result; END; END; END; BEGIN dialog1 := CreateLayout('Example Dialog', FALSE, 'OK', 'Cancel'); CreateColorPopup(dialog1, 4, 24); SetFirstLayoutItem(dialog1, 4); result := RunLayoutDialog(dialog1, Dialog_Handler); END; BEGIN vsoGetEventInfo(theEvent, theButton); CASE theEvent OF {User has single-clicked the object's 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; {Alternatively, you can use this to tack individual parameters onto the end of the list one at a time. This way, you don't have to use SetParameterVisibility in the reset event to hide parameters that you never want to see.} sourceFieldNumber := 1; displayString := 'My Great Field Name'; result := vsoAppendParamWidget(sourceFieldNumber, displayString, thisDoesNothing); {Finally, we add the button.} displayString := 'Color Select'; 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 color := ColorPopUp; {pops up a color select dialog} h := FSActLayer; {selects the rectangle created else where in the script} setclass(h, 'None'); {If this line is commented out the script doesn't work as intended} ColorIndexToRGB(color, r, g, b); {converts the value from the colorpopup function to RGB} SetFillback(h, r, g, b); {sets the color of the rectangle} RedrawSelection; {refreshes the rectangle to show new color} END; END; END; {Object reset has been called.} kResetEventID: BEGIN Rect(0, 0, 1, 1); END; END; END; RUN(Example3);
  15. I've got a bit of code that is making me scratch my head. I combined a couple examples to create a button in the Object Info Palette for a rectangle. The button triggers a color select dialog. color := ColorPopUp; {pops up a color select dialog} h := FSActLayer; {selects the rectangle created else where in the script} setclass(h,(GetClass(h))); {If this line is commented out the script doesn't work as intended} ColorIndexToRGB(color, r, g, b); {converts the value from the colorpopup function to RGB} SetFillBack(h, r, g, b); {sets the color of the rectangle} RedrawSelection; {refreshes the rectangle to show new color} As this was a mash up of a few different experiments the code was a little sloppy. Once I got the script to run and do what I wanted I went back to clean the code up. When I remove or comment out the setclass line the script stops working as I want it to. With the line commented out the color in the attribute palette changes to match the selection but the rectangle does note change. If I click on the Attribute Palette and select solid for the fill it ' pushes' the color to the rectangle. Changing the line type also 'pushes' the color. Any idea what is going on here and why setclass seems to the the fix? Surely there is a cleaner way...
×
×
  • Create New...