Jump to content

MullinRJ

Member
  • Posts

    2,017
  • Joined

  • Last visited

Everything posted by MullinRJ

  1. @Alexander Zemtsov, Pwidth, Pdepth, and Pheight are programmer defined parameters in the Plug-in object. The are displayed in the OIP at runtime (without the leading "P") and you use them to change the shape of the Plug-in object on the drawing. You can see all of the plug-in's "P" parameters by using the Plug-In Editor. In the code, they are effectively constants that are loaded before the code runs. HTH, Raymond
  2. @lucioing, GetWSFromImage(FSActLayer); { will return a handle to the WS Resource, when FSActLayer points to a worksheet image on the drawing. } GetName(GetWSFromImage(FSActLayer)); { will return the name of the WS resource, when FSActLayer points to a worksheet image on the drawing. } HTH, Raymond
  3. This is actually quite moot, but there are 3 dashes that are able to be typed from a Mac keyboard: 1) the hyphen, or minus-sign: "-" 2) the n-dash (Option-hyphen*): "–" 3) the m-dash (Shift-Option-hyphen*): "—" * on the Mac Keyboard I'm sure you can get there from a Windows keyboard, but I don't know the escape codes off the top of my head. Okay, I looked them up: type "Alt 0150" for an n-dash and "Alt 0151" for an m-dash. Nit–pickily yours, Raymond
  4. I believe that exceeds the scope of your original question. More programming will be required. Much more. Raymond
  5. @SamIWas, After a little playing, I found one way to populate a Symbol Popup Menu: index := InsertImagePopupObjectItem(dialogid, menuID, SymNam); And it appears you can also use: index := InsertImagePopupResource(dialogID, kImagePopupID, listID, index); where you use one of the BuildResourceList commands to build a list of symbol definition names, though I haven't tried this explicitly. Have fun, Raymond
  6. Hello @SamIWas, For your symbol popup item, look at: CreateThumbnailPopup(dialogID, item_number); Sorry, I don't have any example code to populate it. I assume your LayerName popup menu is already populated, but if not, use: GetChoiceCount(dialogID, menuID, Cnt); AddChoice(dialogID, menuID, 'menu item text', Cnt); in a loop to add items to the end of the menu. This code would go in the SetupDialogC section of the dialog handler. To select an existing menu item to be the chosen item, use: SelectChoice(dialogID, menuID, menuPos, TRUE); where menuPos is the position of the Active Layer Name in your list. I believe counting in SelectChoice is 1-based, but if I'm wrong, it's 0-based. Easy enough to test. This code also goes in the SetupDialogC section of the dialog handler. HTH, Raymond
  7. Second thought, if you use the Reshape Tool and draw a marquee around the ends to be moved, can you resize multiple PIOs then? One is scaling, while the other is moving, so they're not the same but it might be useful. Raymond
  8. @VectorGeek, How is your Interactive Mode set? If it's not on the 3rd position, as shown here , then you cannot scale multiple objects at the same time. Use the U key to move positions when the Selection Tool is active. If that doesn't help, wait for @PatStanford's answer. 😉 HTH, Raymond
  9. Here's a very useful script you'll have a hard time ferreting out of the Script Documentation. Sorry, it's in Pascal, so you'll have to Pythonize it. Like you, it's bed time. I assume you can build your list from this. Good luck, good night. PROCEDURE xxx; { Show the name of each symbol definition that has the record name 'Bob' attached to it. } CONST RecName = 'Bob'; function DoIt2It(H :Handle) :Boolean; Begin if (Eval(H, (R IN [RecName])) = 1) then AlrtDialog(GetName(H)); { show Symbol Name } End; { DoIt2It } BEGIN ForEachObjectInList(DoIt2It, 0, 0, FSymDef); END; Run(xxx); Raymond
  10. Which items? Different items reside in different lists. The SymbolDefs are in their own list. The Resource Manager presents items from multiple lists, making it look like they are all under one roof, but they are not. Raymond
  11. Quick answer: vs.ForEachObjectInList() There is a nearly perfect example in the Function Reference. Raymond
  12. PROBLEM SOLVED! I just installed macOS Catalina Security Update 2021-008. After it rebooted I launched VW 2020 and immediately opened the Plug-in Manager. This time it opened, so it was OS related. WHAT A TIMELY RELIEF. Good call @zoomer.
  13. Hi @zoomer, Interesting, but VW 2022 works perfectly under OS 10.15.x. VW 2022 OS support is why I updated my OS last summer, and until November all VW versions were working. I am able to draw in VW 2020, and even run scripts, without a problem. It is only when I try to open the Plug-in Manager that VW crashes. In your comment above, I think you may have confused macOS 11 with macOS 10.11. I do that a lot. I just went back to the release notes of VW 2020, 2021, and 2022 and looked at the OS support notes, every SP release. This is what I found: VW 2022 – macOS 10.12.6, 10.13.6, & 10.14 are no longer supported. Use macOS 10.15 (Catalina.) VW 2021 – macOS 10.11.6 is no longer supported. Use macOS 10.12. VW 2020 – No OS restriction notes posted. The thought crossed my mind. It's pretty easy to reload back versions of VW. Not so with macOS'es. Thank you kindly for your reply, Raymond
  14. Hello, I am out of ideas. My friends are out of suggestions. Hopefully someone reading this may have some insight. As of a few weeks ago, VW 2020 SP6 (580724) started crashing every time I try to open the Plug-in Manager, CMD-Shift-Z, or menu Tools>Plug-ins>Plug-in Manager. Prior to the first crash, VW 2020 worked reliably. I am currently running Mac OS 10.15.7. When I boot under 10.12.6, VW 2020 works as expected, so I am guessing it has something to do with the OS, but that's purely a guess. Things I have tried: 1) Remove the 2020 User Folder and reboot. VW 2020 rebuilds a new User Folder, but crashes when I try to open the Plug-in Manager. 2) Delete the RM Cache under \Library\Application support\Vectorworks RMCache\rm2020. Same result after computer reboot, crash on opening Plug-in Manager. 3) Ran Uninstall.app in the VW 2020 folder then copied VW 2020 SP6 from a backup drive to the Applications folder. Same result, crash on opening Plug-in Manager. 4) Copy VW 2020 SP5 from a backup drive to the Applications folder. Same result, crash on opening Plug-in Manager. 5) Reboot under OS 10.12.6. VW 2020 SP6 works as expected. Note – VW 2019 (and earlier), VW 2021, and VW 2022 still working just fine. I updated the OS from 10.14.x to 10.15.x on 20 Jul 2021. Everything was working in VW 2020 until mid November, and I have no idea what happened. Any advice welcome. Thank you, Raymond
  15. Hello @Jayme McColgan, I'm not sure. I know you can display Symbols as a dialog control item, so possibly you could create a temporary symbol and update it as you change dialog fields, then update the dialog display to show the change. See vs.CreateSymbolDisplayControl() and vs.CreateSymDispCtrlN(). Also, you can launch another dialog with the push of a button in the first dialog. This I've done before. What you put in the second dialog is wide open, but you must close the second dialog to return control to the first. Good luck, Raymond
  16. Hi @Jiajing, I got an email from the Forum from your earlier post which you since modified, so you may already have the answer, but in case not, here is a more explicit use of the call. Xdesired = 123 # your desired image width Himg = vs.FSActLayer() # handle to image object (x1, y1), (x2, y2) = vs.GetBBox(Himg) xcen, ycen = vs.HCenter(Himg) scaleF = Xdesired / (x2-x1) # for uniform scaling vs.HScale2D(Himg, xcen, ycen, scaleF, scaleF, False) HTH, Raymond
  17. Hello @Jayme McColgan, Since the dialog event handler script runs every time you type in your dialog, you can process each character as you type it and update another field at the same time. Use vs.GetItemText() ro read your typed data. In the IF clause for the EditText item use vs.SetControlText() to update a static text field. You can also change EditReal and EditInteger fields in real time with calls to vs.SetEditReal() and vs.SetEditInteger(), respectively. This can be used when two fields are linked like Radius and Diameter of a circle or arc. Changing one updates the other. To your second question, I haven't tried this in the sense you are referring, but you could play with vs.SetEdgeBinding(). I've used it in resizable dialogs but never in a fixed dialog. Also, there is vs.AlignItemEdge(). I've tried to get things to right align with it but haven't done so satisfactorily, and always resorted to other layout methods. HTH, Raymond
  18. Hello @Jiajing, Have you tried HScale2D()? Raymond
  19. Hello Riley, From your date of 1995, I suspect the files were created with MC 5, or earlier. When I opened your files I got errors. Initially I got a "This file was saved in a BETA version" error when I opened the files in older versions of the program. Then I tried forcing the file types and creators to MiniCAD versions 2 through 6 but received a " Resource Manager" error. You're right the files are small. These files are almost as small as blank documents. I am wondering if all of the file's data are present. If your files had any complexity to them they should be somewhat bigger. If you find different backups please try back. Sorry I cannot help further at this time. Raymond
  20. Nice result. Yeah, it takes some time to figure out where some of the "missing" pieces are in VectorScript. Spend some time looking at coding examples posted in these Fora. And when using the Script Reference, check both the HTML and the online Developer site. Sometimes they differ, mostly in the comments added to the online pages. As a quick resort, post questions here. It's a large brain trust. Do you mean manually or programmatically? The former can be done under menu File>Import>Import Shapefile..., but the latter is currently unsupported (best I can tell). I have imported one or two Shapefiles years ago, for grins, and they ended up being huge in polygon counts. It is possible VW will choke on larger ones, but it should be able to be done. If you need to do it programmatically, then your best bet is to add a post to the Feedback>Wishlist section of this Forum. All the best, Raymond
  21. I haven't tested your code, but one thing stands out. You place the symbol with CreatedSymbol=vs.Symbol('Canopy-1', X, Y, 0) but vs.Symbol does not return a handle as a result and I suspect CreatedSymbol is 0, or nil, after execution. Therefore your next line SymbolHandle= vs.GetObject(CreatedSymbol) is going to return a nil value since vs.GetObject(nil) is nil. What you probably want is: vs.Symbol('Canopy-1', X, Y, 0) # place symbol SymbolHandle = vs.LNewObj() # get handle to new symbol instance vs.SetRecord(SymbolHandle, 'canopyPNTSRec') # attach record to symbol instance Ain't programming fun? HTH, Raymond
  22. Hello, @Elle. I think it has to do with your Zoom Level and Layer Scale combined. When you zoom out far enough at any grid setting, the grid will disappear at some point. Either Zoom In, or reduce your Layer Scale (or both) to see the reference grid. Consider how many grid lines you'd have on screen at 1/2" spacing, zoomed out to 29%, with a Layer Scale of 1:100 (numbers I gathered from your screen shot above.) I think your screen would be solid blue if all of the reference grid lines displayed. You can also change your reference grid to 36", or larger, if you need to work at that zoom and layer scale. Play with the settings. I believe you can find something that works for you. HTH, Raymond
  23. Hey Sam, Like you, it did not at first make sense to me either, but with a little experimentation it appears both ends of the dimension need to be on the object for the association to stick. I am surprised there is not a similar call that requires 2 handles to specify the object AND the dimension. Oh well, c'est la vie. I've never used this, but have you played with AddAssociation()? The documentation is no worse than that of AssociateLinearDimension(). Raymond
  24. Try narrowing your criteria. vs.ForEachObject() looks at EVERY object in the drawing unless you tell it not to. As you create symbols, you are adding them to the end of the list of searchable objects, so vs.ForEachObject() processes them right after looking at every object that was on your design layer when the script started. In some situations, this can result in an infinite loop. In one of my examples above I suggested adding (T=Locus) to your criteria. Try it. Doing so will tell vs.ForEachObject() to only look at Loci, and your new symbols will escape processing. Then you can add the vs.DelObject() line back. Raymond
  25. Thanks, Josh. Ya just learned me sumthin' new. It works like a charm. I guess it's an SDK PIO. PROCEDURE OnePass; { Create the Wide Flange PIO, move it into position, then hatch it. } VAR H, Beam_Handle :Handle; BEGIN Beam_Handle := CreateCustomObject('Wide Flange', 0, 0, 0); SetObjectVariableBoolean(Beam_Handle, 1167, true); HMove(Beam_Handle, 50, 0); SymbolToGroup(Beam_Handle, 1); { decompose PIO } H := LActLayer; { top object on active layer } message(H, ' ', GetTypeN(H)); END; Run(OnePass); Or he could use the 'Wide Flange - 3D' and avoid all the muss and fuss. Thanks again, Raymond
×
×
  • Create New...