Jump to content

MullinRJ

Member
  • Posts

    2,130
  • Joined

  • Last visited

Reputation

605 Spectacular

Personal Information

  • Occupation
    Circuit Board Designer
  • Location
    United States

Recent Profile Visitors

9,523 profile views
  1. @matteoluigi, In each of my template files I have placed and saved a blank script file. See pic. Over the years this has saved me hours by not having to create a palette, a script, and enter the basic opening and closing lines. Once your templates have an embedded empty script, all you have to do is open a new file and your script awaits your every command. Raymond
  2. Make them both 72 dpi. I hope that's all it is. If not, write back. Raymond
  3. Hello @Tim Harland, You are very welcome. Glad I could help. I was there nearly 15 years ago when I first tried this approach. Your question brought back memories. Because it sometimes runs quite slowly, I also tried ResetObject() in place of the Open/Close Edit Symbol calls, which worked for me and sped things up a bit. You might try it, too. Maybe try it multiple times because some symbols are nested, though I'm not sure if that will do anything. It may be worth a try. All the best, Raymond
  4. Well, I provided the script asked for. You say it not does not update the symbol, but it used to. However, due to speed issues I switched to ResetObject() quite a while back. I can confirm that ResetObject(H) in the FEOIL function will reset symbol definitions in the drawing, but I don't use referenced symbols so I didn't want to guess how they would be affected. Nor did I have the time to try to recreate his particular scenario. I can also confirm that RedrawAll is not needed to complete a symbol update. Raymond
  5. Try this one on for size. It steps through the symbol library and does not require any symbols to be placed in the drawing. Visit Symbols.vs HTH, Raymond
  6. A short lived victory. 🥳 You are the standard to which we all must compete. I shall celebrate swiftly then return to my keyboard. Keep the bar high. I'm counting on you. 😉 Raymond
  7. Try: IF (rotationXAng = -45) AND (rotationYAng = Iso) AND (rotationZAng = 30) THEN ViewTitle := 'Left Isometric'; One too many minus signs. 😉 Raymond
  8. @Ben Wingrove, Here is a script that will hide classes that have no objects in them. It checks all of the objects on the drawing, then checks all of the objects in the symbol library. It does not check if a symbol with objects in a unique class is placed on the drawing, so a class may still be visible even if there are no objects on design or sheet layers that contain an object in that class. I hope that is not too confusing. This script is not extensively tested, so if you find a scenario where it doesn't work, please write back. Hide MT Classes.vs All the best, Raymond
  9. @Jesse Cogswell, I have a script, but I'm having trouble posting the file. Will try again later this afternoon. Raymond
  10. Hello, @AlHanson. When you run the second example, do you see a slider dialog? I just ran it three times and got the following results: I did have trouble retrieving the value of the slider's position (gSlider), since Python does not like to wait for interactive routines to finish. Placing a Message() or AlrtDialog() call after the dialog call reports "0" for the gSlider variable since Python executes the Message() call before the dialog finishes. It might behoove you to write your script in VectorScript, unless you need something specifically Pythonesque in your code. Dialog interaction works very nicely in VectorScript, and it's easy to debug. If you do find a way to capture the gSlider value after the dialog runs, you can pass it to the gradient calls, but you'll have to do the math to translate the gSlider value to meaningful gradient values. I chose 1-1000 for the slider's min and max values, but you can pick any values you want. Raymond
  11. @MatthewW, Is your FEOIL code running inside a Plug-In object, or is it running outside of all Plug-In objects and just processing PIO objects in the drawing? Is your code causing the PIOs to regenerate? If it is running from inside a PIO and looking at objects on the outside, it very well may be running multiple times. PIOs run several times for different reasons. Where you place your FEOIL loop inside the PIO code, and how you write your code will determine how many time it will execute. There are ways to limit unwanted executions of the FEOIL loop, but for any of us to make any meaningful suggestions we will have to know a bit more about what you are doing, and what you are wanting to achieve. If you're running your FEOIL code outside of a PIO, are you calling vs.ResetObject() or vs.RedrawAll? These can also affect performance. All the best, Raymond
  12. You can also use ForEachObjectInList() to process objects residing on another layer. This way your routines can create objects on the Active Layer while processing objects on another layer and the lists won't intermingle. Use vs.FSObject(LyrHandle) or vs.FObject(LyrHandle) to get the first handle to the objects you want to process, and pass that handle to the ForEachObjectInList() call. Raymond
  13. Hi @Sam Jones, Here are the example scripts I mentioned earlier. Like you, I could not get the List Box created with CreateListBoxN() to set multiple choices by script, but when the dialog is running the user can manually make multiple selections which can be tested when the dialog closes. When I failed to make your code work, I wondered if using a List Browser, with CreateLB() would work – it does. It is a bit more tedious to setup but it does allow for multiple selections to be set by script. The calls are completely different when using these two approaches. I am going to post a bug on the problem of no multiple selections by script when using the ListBox. See if the LB approach meets your needs and let me know if this helps. Shout Out to Carlotta for an example she posted nearly two decades ago. Yes, I do try your code examples, but sometimes it takes me a while. 😉 LB Test v2020.vwx All the best, Raymond
×
×
  • Create New...