Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - billo

Pages: [1]
1
Scripts and Plugin Help / Get Directory of opened file
« on: January 28, 2023, 17:20:07 pm »
In my process I want to open a .dfx file and then automatically produce gcode into the Directory than contains that .dfx. Everything works nicely, except that I can't seem to find the name of the Directory from which the .dfx was loaded.

I see that it is actually stored in "CamBam 1.0.config" in "<DefaultDrawingDirectory>C:\MyLocalFiles\CamBamTemp</DefaultDrawingDirectory>" (I suppose I could open the .config and scan directly, but ugh).

I've tried the enticing CamBamConfig.DefaultDrawingDirectory, but that returns a "getset_descriptor". Is there a way to evaluate that to the actual property value?

Or, is there another way to get what I need?

tia, Bill

2
Scripts and Plugin Help / Avoid filename prompts in GenerateGCodeOutput
« on: January 23, 2023, 16:54:00 pm »
I'm looping over Parts and calling CAMUtils.GenerateGCodeOutput to produce a separate .nc file for each Part.

This puts up a file prompt dialog for each part. That works fine, but I have a large number of Parts and would like to provide a filename in script to avoid the file prompts.

Is this possible?

Bill

3
Scripts and Plugin Help / Access XData in .dfx
« on: January 17, 2023, 22:36:14 pm »
I've exported a .dfx from Rhino that contains one XData field that I would like to access from a script (along with LayerName). In browsing the Entity object in an Object Browser I don't see anything that looks promising.

I'm guessing this is not possible. If someone knows how to do this please share.

(My best workaround might be to encode data into the Layer property in Rhino and then decode in CamBam, but that gets ugly in a hurry.)

Bill

4
Scripts and Plugin Help / How to loop over all styles in script
« on: January 10, 2023, 19:44:35 pm »
I'm trying to loop over all available styles (using a python script). Documentation for CamBamUI says I am able to do that using CAMStyles.

CamBamUI.CAMStyles returns a CAMStyleManager, but I do not see how to get from the CAMStyleManager object to an iterable list of styles.

Any advice?

Tia
Bill

5
Scripts and Plugin Help / Getting started with plugins in Win10
« on: January 09, 2023, 15:13:56 pm »
I'm trying to create a plugin for CamBam Plus 1.0 in VS2019. I'm using the code from the tutorial: http://www.cambam.info/doc/api/CreatingAPlugin.htm

As recommended, I used the link in: http://www.cambam.info/downloads/ to install Framework 4.

That installs .Net Core 3.1, which supposedly contains many legacy frameworks, such as Framework 4.

Now when starting a new Project in VS2019, the Target Frameworks presented as options include: .Net Standard 2.0, and .Net Core 3.1. I chose .Net Core 3.1.

My first compile complained that System.Drawing.Common is not available. Reading online I see that adding that package with NuGet is the solution. The oldest version available was 4.5. I downloaded that and added it as a reference.

Now it compiles without errors or warnings.

I copied my plugin .dll and System.Drawing.Common to the plugins folder.

Upon starting CamBam I get the message: Could not load file or assembly 'System.Runtime, Version=4.2.1.0, Culture=neutral, ...

I've used VS for 2 decades, but never with a mix of older components like this; so I am unfamiliar with assembly redirects and such.

Does anyone have advice on how to proceed?

Tia,
Bill

Pages: [1]