Jump to content

SamIWas

Member
  • Posts

    409
  • Joined

  • Last visited

Everything posted by SamIWas

  1. Oof....I feared that this might require event enable. That is just something I have not wrapped my head around yet. Maybe one day...
  2. Is there a way to create collapsible sections in the OIP for a PIO object, such as in the door object shown in the image? Or is that something available only through the SDK? I have a PIO that I have written which has a lot of different sections, and it can get confusing without a visual divider of sorts. I would love to be able to collapse unused sections.
  3. That's what I figured. That you. The SDK is probably waaay out of my wheelhouse.
  4. I have written a PIO which has some pipe elements in it (just created using a sweep, but could do a different way). Is there any way to make an object within a PIO act as a hanging position so that lighting devices would stick with it when the object moves? And not just if the PIO moves, but if parts within the PIO move according to user input.
  5. That did the trick. Don't even need to convert it back to a mesh.
  6. I went way outside my normal world and used vector script to create a mesh of an object which I couldn't build using standard script tools. I built the object in Vectorworks, then exported it as a 3d vector script to get the mesh coordinates. Then I added all that into a script that I am writing to build that part of the object. That all works exactly as intended. BUT, I want to be able to scale that mesh with user input. So, I added some scaling fields into the OIP. Cool. All that is great, except at the mesh doesn't scale. Here's a general layout of the code: BeginGroupN(groupname); BeginMesh; ClosePoly; *a bunch of 3d poly coordinates* EndMesh; EndGroup; Now, I have tried HScale3d both just after EndMesh with LNewObj as the handle, and after EndGroup with "group name" as the handle. Neither seems to have any effect. Is there a step I'm missing here to scale a mesh overall?
  7. I think the number depends on the alignment of the planets, and it will change over time. I used to have a massive workspace full of custom scripts which made my workflow exceptionally fast. Then somewhere around 2015, workspaces started to break apart if there were too many scripts. Many just wouldn't run. This lasted for years. 2021 seemed to fix it, and I loaded up my workspace again, and it worked well. Then, over time, commands started to break, not work at all, or call up completely random other commands. I've never figured out an actual number. Hopefully, 2022 fixes it, but I'm not holding my breath.
  8. We are the same....I really lament the loss of Message functionality for debugging.
  9. Man...it's been over a month since you posted this, but thank you. I will try this!
  10. I wrote a script which does some spotlight lighting device numbering tricks that the Vectorworks numbering tool does not do. It all works perfectly as intended. But a friend testing it for me says that the instruments updated by the script do not update in the XML file which is used as the data exchange between spotlight and Lightwright. He says a change in the OIP works, changes via the numbering tool work, and changes made via "edit divide" work, but changes made via the script do not. Even after making other changes in the document, instruments numbered only by the script do not update. Is there some kind of syntax which can be used in a vector script to update the field for Lightwright? I do not use Lightwright, so I can't look into it myself.
  11. Thanks guys! I will look into this tomorrow. Seems easy enough..........
  12. So, say I have a script with a dialog where the user can input several values. in this case, let's say it's a pull-down menu. What is the method used so that the next time the script is run, the last-chosen or last-inputted value is populated in the dialog? I'm assuming it has something to do with string definitions or something, but I haven't delved into this yet. Or maybe it's in the parameters? Example: Script is run, and the dialog has an edit box named "Start" where the user enters "100" as the value. The next time the script runs, I want "100" to be in that edit box. Or if they choose "Channel" from a drop down, then "Channel" would be the chosen option next time.
  13. Every time I move my laptop, I have to reposition every pallete in VW. Gets so damn annoying!
  14. Building a script where I can right click on a pipe, choose a fixture, then have the script place fixtures on the pipe at either a fixed distance or per specified degree along the curve of a curved pipe. There are options between duplicate array, move by points, or align and distribute, but I don't believe any of them allows you to pick a pipe and a fixture and automatically distribute. I know how to do all the aligning and placing, I can figure out the length and radius of pipes and feed them in, but following paths is the harder part. For instance, when using a curved lighting pipe, it's fairly straightforward to get the length and radius of the pipe (although dimension fields come in with very strange formatting), but there's nothing in the pipe records which indicate the starting and ending angle of the pipe, it's center of arc, or rotation, at least as far as I can find. So, I figure I need to pull in the underlying arc to get its information.
  15. Oooh...thanks guys, I will test these out. I don't think the script I'm trying to write will work out because I'm not sure you can pull info from the underlying polygon/arc in a lighting pipe. But, this still gives me some stuff to play with.
  16. Me again...sorry for flooding the forum, but I'm on a writing kick... So, in custom PIOs, it's easy to show/hide/grey etc different parameters in the OIP. I assume the same thing is possible in custom dialogs, as things like the door tool change options in the dialog depending on what is in other fields. I'm looking to replicate that, but fear that it may be event-based or something, and I just can't wrap my head around that yet. I was hoping that a simple if/then statement would do it, but it appears to be more complicated than that, since I don't think it parses the field results until the OK button is hit. Any pointers, or is this far more complicated than that? In the handler section.... SetupDialogC: BEGIN AddChoice(dialogid,7,'Angle',0); AddChoice(dialogid,7,'Distance',1); SetItemText(dialogid,9,GetLName(ActLayer)); FOR symindex:= 1 to numsyms DO symindex:= InsertImagePopupResource(dialogid, 5, symlist, symindex); END; In the dialog section.... dialogid:=CreateLayout('Place Fixtures On Radius',TRUE,'Apply','Cancel'); CreateStaticText(dialogid,4,'Select Symbol:',15); CreateThumbnailPopup(dialogid,5); CreateStaticText(dialogid,6,'Mode:',15); CreatePulldownMenu(dialogid,7,20); CreateStaticText(dialogid,8,'Relative Angle:',15); CreateEditReal(dialogid,9,2,0,10); CreateStaticText(dialogid,10,'Length:',15); CreateEditReal(dialogid,11,3,72,10); SetFirstLayoutItem(dialogid,4); SetRightItem(dialogid,4,5,0,0); SetBelowItem(dialogid,4,6,0,0); SetRightItem(dialogid,6,7,0,0); GetSelectedChoiceInfo(dialogid,7,0,lindex,lmode); IF lmode='Angle' THEN BEGIN SetBelowItem(dialogid,6,8,0,0); SetRightItem(dialogid,8,9,0,0); END; IF lmode='Distance' THEN BEGIN SetBelowItem(dialogid,8,10,0,0); SetRightItem(dialogid,10,11,0,0); END;
  17. Alright...I was able to get this to work well enough for now. Can't figure out how to make it show only lighting devices, so in bigger documents, the list is huge. But, it's at least a start. What I was hoping for is something like this, but maybe it's not possible. Thanks for the help so far!
  18. Thanks...this has given me some stuff to look at. The SelectChoice for the layer menu works better than what I had come up with. It appears that it orders the list in alphabetical order, so now I'm just searching for the right way to find the alphabetical index of the layers. Man...the symbol stuff seems harder than I thought. Figured there would be a symbol popup window like what appears in so many tools, but it looks like you have to build it. ugh.
  19. Hey gurus... I wrote a script to place symbols (lighting devices) based on the position of a large container object and all of its settings. It all works exactly how I want it to. Right now, I'm using a couple of workarounds to get the correct final result, but I'd love to figure out a few sticking points.One is getting a symbol chooser in my dialog, and the other is how to populate the layer drop-down with the current layer. Some notes are in the code below (only relevant parts of the entire code are shown). I realize that it might not be up to real programmers type code. So, I thought CreateSymDispCtrlN or CreateSymbolDisplayControl might be the answer, but they display only images. I would like to get the symbol drop-down menu seen in other tools and then be able to pass off the resulting symbol choice to the lsymbol variable. The second issue is the layer dialog. Choosing the layer and passing it to the llayer variable works fine and functions correctly in the script. I just want the menu to default to the current layer, but doing a SetItemText for that component caused weird issues with selecting, so I'm not sure that's it. Any pointers would be very appreciated! FUNCTION Mydialog(var lsymbol:STRING; var langle : REAL; var llayer : STRING ) : BOOLEAN; LABEL 99; VAR dialogid, result : INTEGER; iTest : REAL; PROCEDURE Dialog_Handler(VAR item : LONGINT; data : LONGINT); BEGIN CASE item OF SetupDialogC: BEGIN ***DOES SOMETHING NEED TO GO HERE TO POPULATE THE SYMBOL DIALOG??*** ***I THINK SOMETHING NEEDS TO GO HERE TO POPULATE THE DEFAULT FOR THE LAYER DIALOG*** END; 1: BEGIN GetItemText(dialogid,5,lsymbol); ** THIS IS TEMPORARY UNTIL I CAN FIGURE OUT THE SYMBOL DIALOG AND HOW OT PASS THE RESULT IF GetEditReal(dialogid,7,2,iTest) THEN langle:=iTest; GetItemText(dialogid,9,llayer); END; 2: BEGIN END; END; {case} END; {Dialog Handler} BEGIN dialogid:=CreateLayout('Add Fixtures to Softboxes',TRUE,'Apply','Cancel'); CreateStaticText(dialogid,4,'Symbol Name',20); {CreateSymDispCtrlN(dialogid,5,'Arri SkyPanel S60-c',100,100,5,0,2,1,TRUE);} *** TRIED THE ABOVE AND CreateSymbolDisplayControl, BOTH OF WHICH SHOW ONLY AN ICON, NO MENU CreateEditText(dialogid,5,'Enter symbol here',40); *** THIS IS TEMPORARY UNTIL I CAN FIGURE OUT THE SYMBOL DIALOG CreateStaticText(dialogid,6,'Relative Angle:',20); CreateEditReal(dialogid,7,2,0,10); CreateStaticText(dialogid,8,'Layer:',20); CreateLayerPDMenu(dialogid,9,40); SetFirstLayoutItem(dialogid,4); SetRightItem(dialogid,4,5,0,0); SetBelowItem(dialogid,4,6,0,0); SetRightItem(dialogid,6,7,0,0); SetBelowItem(dialogid,6,8,0,0); SetRightItem(dialogid,8,9,0,0);
  20. Thanks for this. I don't think what I want to do is totally possible (I didn't think it was before I even started), but this temp tool thing could be pretty useful for some other stuff! One day, I will learn more than you've forgotten about this stuff!
  21. I would guess with the first click it would choose one point, then it would draw outlines of the new objects in place as the mouse was moved around based on the mouse position, until the mouse is clicked.. I would guess this would work better as a tool than a script. The end idea is largely based on the "Move By Points" tool, just with different custom options.
  22. I'm trying to figure out how to code the pre-visualiztion of object placement in a script/tool using Vectorscript. When you select an object, then use the "Move By Points" tool, the tool outlines the selected object(s), and dynamically moves them around the workspace as you move the mouse. I have been trying combinations of GetMouse, Mousedown, TrackObject and such, but can't seem to figure this out. Is this even possible, or is it something that only an internal Vectorworks tool can do? Or does it require something like events, which I have never figured out.
  23. My plugin objects. I have custom point-object tools I use for racks, cables, optos, network units, consoles, nodes, etc. In order to make them import/export with FileMaker Pro (where I have an extensive database I use to track every piece), I have a UUID procedure within the tool which assigns a UUID to the object in one of the fields, and as an object name. The object name will change automatically If duplicated, and the procedure will check to see if the ID and name match, and generate a new ID if they do not. But I need the UUID procedure to run again after duplication to make the ID unique to each object. But it won't run unless I change some data. HOLY CRAP. I thought I had tested this before multiple times and it didn't work...but checking "Reset on Move" and "Reset on Rotate" does fix that issue. Now to go update all my plugins!
  24. I just want code to run when an object is duplicated, so my objectID checker will run. But every time I see one of those event-enabled scripts, my mind turns into spaghetti.
  25. Thanks, Kevin. Darn...I was really hoping that it was going to put in a symbol selection menu or a texture selection option. That would be sweeeeeet. I guess the only option for those things is to just type the name into a text box, right?
×
×
  • Create New...