Jump to content

Welcome to eMastercam

Register now to participate in the forums, access the download area, buy Mastercam training materials, post processors and more. This message will be removed once you have signed in.

Use your display name or email address to sign in:

Changing arc sizes as a group


MetalMarvels
 Share

Recommended Posts

I need to change several hundred .096 diameter arcs to .125 diameter arcs (full circles). I have been trying to locate a function similar to the one that allows you to create a point in a group of same sized arcs. If I could create the .125 diameter arcs on a group of points or in the center of a group of arcs - that would work since I can delete a group of same sized arcs (deleting the .096 arcs after creating the "replacement" .125 diameter arcs with same centers). I have not found a function that allows me to do this. Any ideas??

Link to comment
Share on other sites

MetalMarvels,

 

Try X-Form/Offset Contour and Window select all the arcs you have to change. You may have to click outside the group of arcs that you've just windowed to select them all. Once this is done, type in the distance in the Offset Contour dialog and click OK. This should give you the results if the original arcs were all drawn the same way. If they offset to the wrong side, simply Undo immediately and try it again, only change the side from "Left" to "Right", or vise versa, in the Offset Contour dialog. HTH biggrin.gif

Link to comment
Share on other sites

I noticed that I forgot to mention that the arcs I want to change are scattered all over the landscape with two other sizes of arcs in irregular arrays. Even a non-rectangular selection box will be almost as painfull as individually selecting the arcs. I was going to explore moving things to different layers and going from there.

Link to comment
Share on other sites

This script searches on specific arcs but could be modified to search on pretty much anything using the EntityBits and EntityFlags combination.

 

code:

'///////////////// My Constants /////////////////

Const DEF_CURRENT_ENTITY = -1

Const DEF_ARC_LOWER_BOUND = 0.001

Const DEF_ARC_UPPER_BOUND = 1.00

Const DEF_NEW_GROUP = " Arcs"

 

' -- Start Script

Call Main()

 

 

' ////////////////////

' Sub Declaration

' ////////////////////

Sub Main()

 

Dim CArc, CNewArc

Dim bRet, intCounter

Dim dblNewArcs, dblExistingArcs

 

' -- Initialize our counter

intCounter = 0

 

If askValue("Input arc diameter to find", DEF_ARC_LOWER_BOUND, DEF_ARC_UPPER_BOUND, dblExistingArcs) Then

' -- Prompt for new dia

If askValue("Input new arc diameter", DEF_ARC_LOWER_BOUND, DEF_ARC_UPPER_BOUND, dblNewArcs) Then

 

bRet = StartDBSearch(mc_alive, mc_arctype)

 

' -- Begin our loop through our database

Do While bRet

 

Set CArc = New McAr

 

' -- Get this entity

If GetArcData(DEF_CURRENT_ENTITY,CArc) Then

 

' -- Test

If (CArc.R * 2) = dblExistingArcs Then

 

Set CNewArc = New McAr

 

' -- Set our arcs properties from current arc entity

With CNewArc

.X = CArc.X

.Y = CArc.Y

.Z = CArc.Z

.R = (dblNewArcs / 2)

.SA = 0

.SW = 360

.View = mcVIEW_TOP

End With

 

' -- Create our new arc

If CreateArc(CNewArc, mcCOLOR_YELLOW, mcCONSTRUCTION_LEVEL_CURRENT) = mcENTITY_INVALID Then

ShowString "Could not create new arc"

Else

If Not AddCurrentEntToGroup(dblNewArcs & DEF_NEW_GROUP) Then ShowString "Problem adding new arc to group"

' -- Keep a running total

intCounter = intCounter + 1

End If

End If

End If

 

bRet = NextDBSearch

 

Loop

 

 

If intCounter = 0 Then

ShowString "No matching arcs found"

Else

ShowString intCounter & " " & dblNewArcs & " arcs created"

End If

 

End If

End If

 

 

 

 

 

 

 

End Sub

Link to comment
Share on other sites
Guest CNC Apps Guy 1

One problem though - it creates a copy of the arc. FOr example - I created a number of .250 Arcs. I wanted it to change the .250 to .255. It created new .255 arcs.

 

Hmmmm.

 

James teh "puts on debug hat"

 

biggrin.gif

Link to comment
Share on other sites

James,

 

Yes this creates new arcs in the same position as the existing arcs.

 

There is a delete entity function in the next mcamvb update (coming soon) that you can plug into the script to remove the existing arcs that will mimic a 'resize' option, currently we can not write to existing entity properties.

Link to comment
Share on other sites
Guest CNC Apps Guy 1

I was digging through help and surmised that it was not possible yet. This has application though. I create lots of counterbores and stuff like that and this will come in quite handy.

 

Thanks Mick - Keep up the great work.

 

cheers.gif

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.

Join us!

eMastercam - your online source for all things Mastercam.

Together, we are the strongest Mastercam community on the web with over 56,000 members, and our online store offers a wide selection of training materials for all applications and skill levels.

Follow us

×
×
  • Create New...