<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: [macro]Mirror a hole featureset? in PowerMill Forum</title>
    <link>https://forums.autodesk.com/t5/powermill-forum/macro-mirror-a-hole-featureset/m-p/12871361#M5679</link>
    <description>&lt;P&gt;Thanks again. Awesome.&amp;nbsp;&lt;/P&gt;&lt;P&gt;There was a little typewriting mistakes, I corrected and works&lt;/P&gt;&lt;P&gt;fine.&lt;/P&gt;</description>
    <pubDate>Mon, 01 Jul 2024 12:19:32 GMT</pubDate>
    <dc:creator>hrh46</dc:creator>
    <dc:date>2024-07-01T12:19:32Z</dc:date>
    <item>
      <title>[macro]Mirror a hole featureset?</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-mirror-a-hole-featureset/m-p/11351867#M5672</link>
      <description>&lt;P&gt;Trying to mirror all my project entities and I can mirror pretty much everything but featuresets. Anyone have a way around this?&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2022 18:10:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-mirror-a-hole-featureset/m-p/11351867#M5672</guid>
      <dc:creator>danmic7JH66</dc:creator>
      <dc:date>2022-08-10T18:10:07Z</dc:date>
    </item>
    <item>
      <title>Re: [macro]Mirror a hole featureset?</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-mirror-a-hole-featureset/m-p/12864142#M5673</link>
      <description>&lt;P&gt;maybe someone has a macro which can mirror all holes in the feature set? Please share&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jun 2024 07:59:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-mirror-a-hole-featureset/m-p/12864142#M5673</guid>
      <dc:creator>artur.boszczyk</dc:creator>
      <dc:date>2024-06-27T07:59:26Z</dc:date>
    </item>
    <item>
      <title>Re: [macro]Mirror a hole featureset?</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-mirror-a-hole-featureset/m-p/12866355#M5674</link>
      <description>&lt;P&gt;hi,&lt;BR /&gt;this doesn't look straight forward...&lt;BR /&gt;have you considered to export the hole featureset as *.XLM and manipulate the file in python and re-import the new xml&lt;/P&gt;&lt;LI-CODE lang="general"&gt;import xml.etree.ElementTree as ET

# Parse the XML file
tree = ET.parse('features.xml')
root = tree.getroot()

# Define the namespace
namespaces = {'ns': 'x-schema:Features.xml'}

# Iterate over each 'compound_hole' element in the XML
for compound_hole in root.findall('.//ns:compound_hole', namespaces):
    # Create a new 'compound_hole' element
    new_compound_hole = ET.Element('compound_hole')
    
    # Copy attributes from the original 'compound_hole' to the new one
    new_compound_hole.attrib = compound_hole.attrib.copy()
    
    # Append '_mirrorX' to the 'name' attribute of the new 'compound_hole'
    new_compound_hole.set('name', new_compound_hole.get('name') + '_mirrorX')
    
    # Iterate over each 'point' element in the original 'compound_hole'
    for point in compound_hole.findall('ns:point', namespaces):
        # Create a new 'point' element
        new_point = ET.Element('point')
        
        # Copy attributes from the original 'point' to the new one
        new_point.attrib = point.attrib.copy()
        
        # Change the sign of the 'X' attribute of the new 'point'
        new_point.set('X', str(-float(new_point.get('X'))))
        
        # Add the new 'point' to the new 'compound_hole'
        new_compound_hole.append(new_point)
    
    # Iterate over each 'axis' element in the original 'compound_hole'
    for axis in compound_hole.findall('ns:axis', namespaces):
        # Create a new 'axis' element
        new_axis = ET.Element('axis')
        
        # Copy attributes from the original 'axis' to the new one
        new_axis.attrib = axis.attrib.copy()
        
        # Add the new 'axis' to the new 'compound_hole'
        new_compound_hole.append(new_axis)
    
    # Add the new 'compound_hole' to the parent of the original 'compound_hole'
    compound_hole.getparent().append(new_compound_hole)

# Write the modified XML to a new file
tree.write('features_modified.xml')

# Print a success message
print("The XML file was successfully modified and saved as 'features_modified.xml'.")&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jun 2024 07:17:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-mirror-a-hole-featureset/m-p/12866355#M5674</guid>
      <dc:creator>krasimir.vasilev</dc:creator>
      <dc:date>2024-06-28T07:17:04Z</dc:date>
    </item>
    <item>
      <title>Re: [macro]Mirror a hole featureset?</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-mirror-a-hole-featureset/m-p/12866803#M5675</link>
      <description>&lt;P&gt;try this:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;if not entity_exists(entity('featureset','')) {
	message info 'no active featureset'
	return
}

ENTITY $featureset = entity('featureset','')

string List $mirrorPlanes = {'Y-Z','X,Z'}

int $plane = input Choice $mirrorPlanes 'Select mirror plane'

ACTIVATE WORKPLANE FROMENTITY FEATURESET $featureset

EDIT FEATURESET ; DESELECT ALL

Graphics lock
if $plane == 0 {
	foreach $feature in components($featureset) {	
		real $newValue = $feature.WPPoint[$plane] * -1
		EDIT FEATURESET $featureset SELECT $feature
		EDIT FEATURESET ; FEATURE SELECT POSITION X $newValue
		EDIT FEATURESET ; DESELECT ALL
	}
} else {
	foreach $feature in components($featureset) {	
		real $newValue = $feature.WPPoint[$plane] * -1
		EDIT FEATURESET $featureset SELECT $feature
		EDIT FEATURESET ; FEATURE SELECT POSITION Y $newValue
		EDIT FEATURESET ; DESELECT ALL
	}	
}
graphics unlock&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 28 Jun 2024 11:56:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-mirror-a-hole-featureset/m-p/12866803#M5675</guid>
      <dc:creator>icse</dc:creator>
      <dc:date>2024-06-28T11:56:10Z</dc:date>
    </item>
    <item>
      <title>Re: [macro]Mirror a hole featureset?</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-mirror-a-hole-featureset/m-p/12866949#M5676</link>
      <description>&lt;P&gt;thanks for this. It is a good starting point. I'm looking for a more general - mirror about any plane, which may involve setting the axis, and not only positions.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jun 2024 12:49:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-mirror-a-hole-featureset/m-p/12866949#M5676</guid>
      <dc:creator>artur.boszczyk</dc:creator>
      <dc:date>2024-06-28T12:49:03Z</dc:date>
    </item>
    <item>
      <title>Re: [macro]Mirror a hole featureset?</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-mirror-a-hole-featureset/m-p/12868763#M5677</link>
      <description>&lt;P&gt;Very good.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please add commands to ask for keeping original or not.&lt;/P&gt;&lt;P&gt;Thanks in advance&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 29 Jun 2024 13:50:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-mirror-a-hole-featureset/m-p/12868763#M5677</guid>
      <dc:creator>hrh46</dc:creator>
      <dc:date>2024-06-29T13:50:12Z</dc:date>
    </item>
    <item>
      <title>Re: [macro]Mirror a hole featureset?</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-mirror-a-hole-featureset/m-p/12869749#M5678</link>
      <description>&lt;P&gt;try this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;if not entity_exists(entity('featureset','')) {
	message info 'no active featureset'
	return
}

bool $keepOriginal = 0
$keepOriginal = query 'Keep The Original Featureset?'




ENTITY $featureset = entity('featureset','')

if $keepOriginal {
	
	string $newFSName = new_entity_name('featureset',$featureset.Name)
	copy featureset ${featureset.Name}
	
	activate featureset ${newFSName}
	
	$featureset = entity('featureset','')
}


string List $mirrorPlanes = {'Y-Z','X,Z'}

int $plane = input Choice $mirrorPlanes 'Select mirror plane'

ACTIVATE WORKPLANE FROMENTITY FEATURESET $featureset

EDIT FEATURESET ; DESELECT ALL

Graphics lock


if $plane == 0 {
	foreach $feature in components($featureset) {	
		real $newValue = $feature.WPPoint[$plane] * -1
		EDIT FEATURESET $featureset SELECT $feature
		EDIT FEATURESET ; FEATURE SELECT POSITION X $newValue
		EDIT FEATURESET ; DESELECT ALL
	}
} else {
	foreach $feature in components($featureset) {	
		real $newValue = $feature.WPPoint[$plane] * -1
		EDIT FEATURESET $featureset SELECT $feature
		EDIT FEATURESET ; FEATURE SELECT POSITION Y $newValue
		EDIT FEATURESET ; DESELECT ALL
	}	
}
graphics unlock&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;also here i'm not 100%sure if it works ive still dont have a powermill licence...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but it should give you at least a good starting point.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2024 12:35:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-mirror-a-hole-featureset/m-p/12869749#M5678</guid>
      <dc:creator>icse</dc:creator>
      <dc:date>2024-07-10T12:35:15Z</dc:date>
    </item>
    <item>
      <title>Re: [macro]Mirror a hole featureset?</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-mirror-a-hole-featureset/m-p/12871361#M5679</link>
      <description>&lt;P&gt;Thanks again. Awesome.&amp;nbsp;&lt;/P&gt;&lt;P&gt;There was a little typewriting mistakes, I corrected and works&lt;/P&gt;&lt;P&gt;fine.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jul 2024 12:19:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-mirror-a-hole-featureset/m-p/12871361#M5679</guid>
      <dc:creator>hrh46</dc:creator>
      <dc:date>2024-07-01T12:19:32Z</dc:date>
    </item>
    <item>
      <title>Re: [macro]Mirror a hole featureset?</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-mirror-a-hole-featureset/m-p/12888900#M5680</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/14304290"&gt;@icse&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;I've been trying to rename the mirrored featureset to the original featureset name + '-Mirrored'&lt;/P&gt;&lt;P&gt;but I can't seem to get rid of the _1 that's added when you copy an entity??&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2024 12:23:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-mirror-a-hole-featureset/m-p/12888900#M5680</guid>
      <dc:creator>evo80</dc:creator>
      <dc:date>2024-07-10T12:23:27Z</dc:date>
    </item>
    <item>
      <title>Re: [macro]Mirror a hole featureset?</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-mirror-a-hole-featureset/m-p/12888914#M5681</link>
      <description>&lt;P&gt;to do this the KeepOriginal ifstatement should look something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;if not entity_exists(entity('featureset','')) {
	message info 'no active featureset'
	return
}

bool $keepOriginal = 0
$keepOriginal = query 'Keep The Original Featureset?'




ENTITY $featureset = entity('featureset','')

if $keepOriginal {
	
	string $newFSName = new_entity_name('featureset',$featureset.Name)
	copy featureset ${featureset.Name}
	
	activate featureset ${newFSName}
	
	$newFSName = $featureset.Name + '_Mirrored'
	if entity_exists('featureset',$newFSName) {
		$newFSName = new_entity_name('featureset',$newFSName)
	}
	
	$featureset = entity('featureset','')
	
	rename featureset ${featureset.Name} ${newFSName}
	
	
}


string List $mirrorPlanes = {'Y-Z','X,Z'}

int $plane = input Choice $mirrorPlanes 'Select mirror plane'

ACTIVATE WORKPLANE FROMENTITY FEATURESET $featureset

EDIT FEATURESET ; DESELECT ALL

Graphics lock


if $plane == 0 {
	foreach $feature in components($featureset) {	
		real $newValue = $feature.WPPoint[$plane] * -1
		EDIT FEATURESET $featureset SELECT $feature
		EDIT FEATURESET ; FEATURE SELECT POSITION X $newValue
		EDIT FEATURESET ; DESELECT ALL
	}
} else {
	foreach $feature in components($featureset) {	
		real $newValue = $feature.WPPoint[$plane] * -1
		EDIT FEATURESET $featureset SELECT $feature
		EDIT FEATURESET ; FEATURE SELECT POSITION Y $newValue
		EDIT FEATURESET ; DESELECT ALL
	}	
}
graphics unlock&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2024 12:34:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-mirror-a-hole-featureset/m-p/12888914#M5681</guid>
      <dc:creator>icse</dc:creator>
      <dc:date>2024-07-10T12:34:55Z</dc:date>
    </item>
    <item>
      <title>Re: [macro]Mirror a hole featureset?</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-mirror-a-hole-featureset/m-p/12888932#M5682</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My solution&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="visual-basic"&gt;if not entity_exists(entity('featureset','')) {
	message info 'no active featureset'
	return
}

bool $keepOriginal = 0
$keepOriginal = query 'Keep The Original Featureset?'

ENTITY $featureset = entity('featureset','')

string $newFSName = new_entity_name('featureset',$featureset.Name)

if $keepOriginal {
	copy featureset ${featureset.Name}
	// Activate the copied featureset
	activate featureset ${newFSName}
	$featureset = entity('featureset','')
}

string List $mirrorPlanes = {'YZ','XZ'}

int $plane = input Choice $mirrorPlanes 'Select mirror plane'

ACTIVATE WORKPLANE FROMENTITY FEATURESET $featureset

EDIT FEATURESET ; DESELECT ALL

Graphics lock

if $plane == 0 {
	foreach $feature in components($featureset) {	
		real $newValue = $feature.WPPoint[$plane] * -1
		EDIT FEATURESET $featureset SELECT $feature
		EDIT FEATURESET ; FEATURE SELECT POSITION X $newValue
		EDIT FEATURESET ; DESELECT ALL
	}
} else {
	foreach $feature in components($featureset) {	
		real $newValue = $feature.WPPoint[$plane] * -1
		EDIT FEATURESET $featureset SELECT $feature
		EDIT FEATURESET ; FEATURE SELECT POSITION Y $newValue
		EDIT FEATURESET ; DESELECT ALL
	}
}

graphics unlock

// Add "-Mirrored" to the end of the featureset name
$newFSName = $newFSName + "-Mirrored"

// Rename the featureset with the new name
rename featureset ${featureset.Name} ${newFSName}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2024 12:43:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-mirror-a-hole-featureset/m-p/12888932#M5682</guid>
      <dc:creator>iamcdn79</dc:creator>
      <dc:date>2024-07-10T12:43:29Z</dc:date>
    </item>
    <item>
      <title>Re: [macro]Mirror a hole featureset?</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-mirror-a-hole-featureset/m-p/12888934#M5683</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/14304290"&gt;@icse&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Cheers, that nailed it!&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2024 12:38:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-mirror-a-hole-featureset/m-p/12888934#M5683</guid>
      <dc:creator>evo80</dc:creator>
      <dc:date>2024-07-10T12:38:49Z</dc:date>
    </item>
    <item>
      <title>Re: [macro]Mirror a hole featureset?</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-mirror-a-hole-featureset/m-p/12888955#M5684</link>
      <description>&lt;P&gt;no one has done this in macros?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.gamedev.net/forums/topic/411626-mirror-a-vector-around-a-plane/" target="_blank"&gt;https://www.gamedev.net/forums/topic/411626-mirror-a-vector-around-a-plane/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2024 12:46:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-mirror-a-hole-featureset/m-p/12888955#M5684</guid>
      <dc:creator>artur.boszczyk</dc:creator>
      <dc:date>2024-07-10T12:46:21Z</dc:date>
    </item>
    <item>
      <title>Re: [macro]Mirror a hole featureset?</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-mirror-a-hole-featureset/m-p/12889050#M5685</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3960527"&gt;@iamcdn79&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That is what I did originally, only thing with this is it doesn't rid the _1 or whatever when you copy an entity,&lt;/P&gt;&lt;P&gt;however, the code from&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/14304290"&gt;@icse&lt;/a&gt;&amp;nbsp;does.&lt;/P&gt;&lt;P&gt;Thanks for the help btw!&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2024 13:24:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-mirror-a-hole-featureset/m-p/12889050#M5685</guid>
      <dc:creator>evo80</dc:creator>
      <dc:date>2024-07-10T13:24:06Z</dc:date>
    </item>
    <item>
      <title>Re: [macro]Mirror a hole featureset?</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-mirror-a-hole-featureset/m-p/12914453#M5686</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/14304290"&gt;@icse&lt;/a&gt;&amp;nbsp;if the workplane from the featureset doesn't exist would this be a good way to use the world workplane instead?&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;if not entity_exists(entity('featureset','')) {
    message info 'No active featureset'
    return
}

bool $keepOriginal = 0
$keepOriginal = query 'Do you want to copy the active hole featureset?'

ENTITY $featureset = entity('featureset','')

string $newFSName = new_entity_name('featureset', $featureset.Name)

if $keepOriginal {
    copy featureset ${featureset.Name}
    // Activate the copied featureset
    activate featureset ${newFSName}
    $featureset = entity('featureset','')
}

string List $mirrorPlanes = {'YZ','XZ'}

int $plane = input Choice $mirrorPlanes 'Select mirror plane'

// Check if the workplane entity exists
bool $workplaneExists = entity_exists(entity('workplane', $featureset.Name))

if $workplaneExists {
    ACTIVATE WORKPLANE FROMENTITY FEATURESET $featureset
} else {
    // Activate a default workplane if the specified workplane does not exist
    ACTIVATE WORKPLANE " "
}

EDIT FEATURESET ; DESELECT ALL

Graphics lock

if $plane == 0 {
    foreach $feature in components($featureset) {    
        real $newValue = $feature.WPPoint[0] * -1  // X value
        if not $workplaneExists {
            // Apply the transformation using the world workplane
            $newValue = $feature.Point[0] * -1  // X value using world workplane
        }
        EDIT FEATURESET $featureset SELECT $feature
        EDIT FEATURESET ; FEATURE SELECT POSITION X $newValue
        EDIT FEATURESET ; DESELECT ALL
    }
} else {
    foreach $feature in components($featureset) {    
        real $newValue = $feature.WPPoint[1] * -1  // Y value
        if not $workplaneExists {
            // Apply the transformation using the world workplane
            $newValue = $feature.Point[1] * -1  // Y value using world workplane
        }
        EDIT FEATURESET $featureset SELECT $feature
        EDIT FEATURESET ; FEATURE SELECT POSITION Y $newValue
        EDIT FEATURESET ; DESELECT ALL
    }
}

graphics unlock

// Add "mirror" to the end of the featureset name
$newFSName = $newFSName + " mirrored "

// Add the workplane used to mirror to the end of the featureset name
if $plane == 0 {
    $newFSName = $newFSName + " in the X"
} else {
    $newFSName = $newFSName + " in the Y"
}

// Rename the featureset with the new name
rename featureset ${featureset.Name} ${newFSName}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jul 2024 12:38:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-mirror-a-hole-featureset/m-p/12914453#M5686</guid>
      <dc:creator>iamcdn79</dc:creator>
      <dc:date>2024-07-23T12:38:47Z</dc:date>
    </item>
    <item>
      <title>Re: [macro]Mirror a hole featureset?</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-mirror-a-hole-featureset/m-p/12914494#M5687</link>
      <description>&lt;P&gt;With my macro if the featureset does not got a workplane the line&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;ACTIVATE WORKPLANE FROMENTITY FEATURESET $featureset&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;should deactivate the current active workplane eg activate the global workplane&lt;/P&gt;&lt;P&gt;then the holes should be mirrored arround the global workplane.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;No edit necessary&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jul 2024 12:57:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-mirror-a-hole-featureset/m-p/12914494#M5687</guid>
      <dc:creator>icse</dc:creator>
      <dc:date>2024-07-23T12:57:09Z</dc:date>
    </item>
    <item>
      <title>Re: [macro]Mirror a hole featureset?</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-mirror-a-hole-featureset/m-p/12914514#M5688</link>
      <description>&lt;P&gt;it didn't work with this code, it just left the featureset hole where it was&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;if not entity_exists(entity('featureset','')) {
	message info 'no active featureset'
	return
}

bool $keepOriginal = 0
$keepOriginal = query 'Do you want to copy the active hole featureset?'

ENTITY $featureset = entity('featureset','')

string $newFSName = new_entity_name('featureset',$featureset.Name)

if $keepOriginal {
	copy featureset ${featureset.Name}
	// Activate the copied featureset
	activate featureset ${newFSName}
	$featureset = entity('featureset','')
}

string List $mirrorPlanes = {'YZ','XZ'}

int $plane = input Choice $mirrorPlanes 'Select mirror plane'

ACTIVATE WORKPLANE FROMENTITY FEATURESET $featureset

EDIT FEATURESET ; DESELECT ALL

Graphics lock

if $plane == 0 {
	foreach $feature in components($featureset) {	
		real $newValue = $feature.WPPoint[$plane] * -1
		EDIT FEATURESET $featureset SELECT $feature
		EDIT FEATURESET ; FEATURE SELECT POSITION X $newValue
		EDIT FEATURESET ; DESELECT ALL
	}
} else {
	foreach $feature in components($featureset) {	
		real $newValue = $feature.WPPoint[$plane] * -1
		EDIT FEATURESET $featureset SELECT $feature
		EDIT FEATURESET ; FEATURE SELECT POSITION Y $newValue
		EDIT FEATURESET ; DESELECT ALL
	}
}

graphics unlock

// Add "mirror" to the end of the featureset name
$newFSName = $newFSName + " mirrored "

// Add the workplane used to mirror to the end of the featureset name
if $plane == 0 {
	$newFSName = $newFSName + "in the X"
} else {
	$newFSName = $newFSName + "in the Y"
}

// Rename the featureset with the new name
rename featureset ${featureset.Name} ${newFSName}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jul 2024 13:06:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-mirror-a-hole-featureset/m-p/12914514#M5688</guid>
      <dc:creator>iamcdn79</dc:creator>
      <dc:date>2024-07-23T13:06:59Z</dc:date>
    </item>
    <item>
      <title>Re: [macro]Mirror a hole featureset?</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-mirror-a-hole-featureset/m-p/12914586#M5689</link>
      <description>&lt;P&gt;You right it does not work correctly if the featureset does use the global workplane....&lt;/P&gt;&lt;P&gt;But it actually should work &lt;span class="lia-unicode-emoji" title=":face_with_tongue:"&gt;😛&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if you keep alternating between the mirror planes x-z / y-z it seems to work&lt;/P&gt;&lt;P&gt;if you use the same plane multipe times in a row (mirror the featureset back) it stops working but i dont know why...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if the featureset got a linked workplane everything seems to work fine.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jul 2024 13:30:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-mirror-a-hole-featureset/m-p/12914586#M5689</guid>
      <dc:creator>icse</dc:creator>
      <dc:date>2024-07-23T13:30:25Z</dc:date>
    </item>
  </channel>
</rss>

