CamBam
News:
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
September 19, 2019, 14:25:58 pm


Login with username, password and session length


  Show Posts
Pages: [1] 2
1  Support / Scripts and Plugin Help / Re: center each part? on: February 06, 2019, 20:19:58 pm
That's what I'm looking for! Thank you!  Smiley
2  Support / Scripts and Plugin Help / center each part? on: February 06, 2019, 16:15:33 pm
Hi all,

I'm trying to figure out how to roll through all parts and center each one individually. I can't just select everything and do an alignment because CAMbam treats the entire selection as a group (Unless I really have the dumbs and have missed some setting) I think that this script: http://www.cambam.co.uk/forum/index.php?topic=6542.msg52564#msg52564 might be a good start. I'm wondering if there's something simple and obvious that I'm missing. Any help/ideas?

Thanks for all the tips and tricks that you all have shared in the past!
3  Support / Scripts and Plugin Help / Re: Saving Gcode automatically to a Directory by Part? on: December 08, 2016, 01:26:38 am
Well, that's easier ... Thanks! Smiley
4  Support / Scripts and Plugin Help / Saving Gcode automatically to a Directory by Part? on: December 08, 2016, 01:05:03 am
Hi all,

I've come up with a way to go through each part and save the gcode for all the MOPs in the part as if you had Right-Clicked on the part and chose Save Gcode. It opens a dialog box to save for each part which gets tedious when you have 60-80 parts. Is there any way to automatically save to a directory without a dialog box? Here's my code. It works well enough and I'll take clicking a bunch of times over doing everything manually, but I'm hoping it can all happen without interaction Smiley Thanks for any help!

Code:
import datetime
today = datetime.date.today()

doc.Filename = today.strftime("%y%m%d")

CAMUtils.GenerateToolpaths(CamBamUI.MainUI.ActiveView)

for part in CamBamUI.MainUI.ActiveView.CADFile.Parts:
CAMUtils.GenerateGCodeOutput(CamBamUI.MainUI.ActiveView, part, part.MachineOps[0])
5  Support / Scripts and Plugin Help / Re: Making a Part with 2 MOPs in Python on: December 06, 2016, 03:11:59 am
Perfect! Thank you! Cheesy
6  Support / Scripts and Plugin Help / Re: Making a Part with 2 MOPs in Python on: December 06, 2016, 01:55:11 am
Okay, one last question for this script:
    How do I center the Mtext as if I had selected the object and did a Transform-> Center (of Extents)

I can't seem to figure out the right way to do this. Everything else is working perfectly Smiley
7  Support / Scripts and Plugin Help / Re: Making a Part with 2 MOPs in Python on: December 06, 2016, 00:09:37 am
There we go! Smiley Worked like a charm on both the Pocket and the VEngrave. Thank You!
8  Support / Scripts and Plugin Help / Re: Making a Part with 2 MOPs in Python on: December 05, 2016, 21:09:04 pm
Argh! ... Can anyone help with creating this MOP? I have an MText that I create in a loop and want to create a MOP for each of these MText's. It wants an array of entities??? Or something??? Thanks for any help. I've been banging on this for 2 hours >.< ... Here's my code:

Code:
# Create Geometry and MOPs from a Construct of Words

myWords = [         [ "a1", "a2", "a3", "a4", "a5", "a6"],
[ "b1", "b2", "b3", "b4", "b5", "b6"],
[ "c1", "c2", "c3", "c4", "c5", "c6"] ]

rowCount  = 1

for row in myWords:
sideCount = 1

doc.CreateLayer("d" + str(rowCount))
doc.SetActiveLayer("d" + str(rowCount))
for side in row:
sideText = MText()

sideText.Text = row[sideCount - 1]
doc.Add(sideText)

# Add a Part (d1s2, etc)
doc.CreatePart("d" + str(rowCount) + "s" + str(sideCount))

# Add Engrave MOP
# HERE IS THE PROBLEM. How do I refer to the entity that I just made (sideText)?:
pocket=MOPPocket(doc,doc.Layers["d" + str(rowCount)].Entities([sideText]))

                # The following will add all entities in a layer (but that doesn't help):
pocket=MOPPocket(doc,doc.Layers["d" + str(rowCount)].Entities)

# add the machine op to the drawing...
CamBamUI.MainUI.InsertMOP(pocket)

# Add V_Carve MOP
                # todo

sideCount += 1
rowCount += 1
9  Support / Scripts and Plugin Help / Re: Making a Part with 2 MOPs in Python on: December 05, 2016, 16:49:27 pm
jk's code ftw! Works! Thanks for the help. You guys probably saved me a couple of days poking at stuff to no avail. I might have a couple of more questions, but this will get me much farther along.

This script I'm writing will take about 4-6 hours of boring, tedious work and whittle it down to around 5-10 minutes and make my business actually viable, so thank you for helping to keep me employed! Smiley
10  Support / Scripts and Plugin Help / Re: Making a Part with 2 MOPs in Python on: December 05, 2016, 14:27:53 pm
Re Vengrave:
    Python Error : NameError: global name 'MOPVEngrave' is not defined

Sad Any ideas?

I'll take a look at adding a list of entities to the Pocket MOP. Thanks!
11  Support / Scripts and Plugin Help / Re: Making a Part with 2 MOPs in Python on: December 05, 2016, 03:32:27 am
So right now I'm looking for how to create a V-Engrave MOP and I'm having difficulty telling the Pocket MOP which piece of geometry to use.

pocket=MOPPocket(doc,doc.Layers["myLayer"].Entities) - gets all entities in a layer, but how do I refer to a specific entitiy?

Any help is much appreciated!
12  Support / Scripts and Plugin Help / Re: Making a Part with 2 MOPs in Python on: December 05, 2016, 03:06:43 am
doc.CreatePart("Part Name") also works Smiley
13  Support / Scripts and Plugin Help / Re: Making a Part with 2 MOPs in Python on: December 05, 2016, 02:55:43 am
For reference, I can add a part now:

testPart=CAMPart("test")
doc.Parts.Add(testPart)

I should be able to add the pocket MOP.

Any suggestions for adding a V-Engrave (from the plugin) MOP?
14  Support / Scripts and Plugin Help / Re: Making a Part with 2 MOPs in Python on: December 05, 2016, 02:08:37 am
Thank you!

Yes, I have gone through that and can create a MOP successfully, but I don't see how to create and place it in a specific part. I also can't see how to do a V-Carve MOP (I realize that it's a plugin, so I'm sure that makes some difference)
15  Support / Scripts and Plugin Help / Making a Part with 2 MOPs in Python on: December 05, 2016, 01:40:12 am
Hi All,

I'm trying to create a script that will roll through a list of words, create an MText and then a Part that contains a Pocket and a V-Engrave for each MText. I need to set options on the MOPs as well.

I've figured out how to create the MText geometry. Can anyone offer a snippet of Python code for creating a Part and the 2 MOPs? I'm running into a brick wall over and over. I'd be greatful for any direction.

I also need to create Toolpaths and GCode from each Part individually if anyone can point me in the right direction there. I haven't looked at that yet though.

Thanks for any help!

--verne
Pages: [1] 2
Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM
Page created in 0.109 seconds with 19 queries.

Copyright © 2018 HexRay Ltd. | Sitemap