<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Plixo&#039;s Blog &#187; CorelDraw Macros</title>
	<atom:link href="http://blog.plixo.com.sg/category/software/coreldraw-macros/feed" rel="self" type="application/rss+xml" />
	<link>https://blog.plixo.com.sg</link>
	<description>News &#38; Articles from Plixo&#039;s team and fans of printing, laser cutting &#38; engraving, plastic processing, pipe and product marking related techniques</description>
	<lastBuildDate>Sun, 17 Sep 2017 19:43:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>CorelDraw add-on for laser cutting 3D parts</title>
		<link>https://blog.plixo.com.sg/2013/12/coreldraw-add-on-for-laser-cutting-3d-parts</link>
		<comments>https://blog.plixo.com.sg/2013/12/coreldraw-add-on-for-laser-cutting-3d-parts#comments</comments>
		<pubDate>Fri, 20 Dec 2013 12:08:34 +0000</pubDate>
		<dc:creator>plixo</dc:creator>
				<category><![CDATA[Acrylic Fabrication]]></category>
		<category><![CDATA[CorelDraw Macros]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[add-on]]></category>
		<category><![CDATA[CorelDraw]]></category>

		<guid isPermaLink="false">http://blog.plixo.com.sg/?p=681</guid>
		<description><![CDATA[We just made public our internal CorelDraw X6 add-on to generate optimized parts for laser cutting boxes : Example of generated paths: See details and files for download in this very useful forum http://forum.oberonplace.com/showthread.php?t=24647 Let us know any comments either on &#8230; <a href="https://blog.plixo.com.sg/2013/12/coreldraw-add-on-for-laser-cutting-3d-parts">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>We just made public our internal CorelDraw X6 add-on to generate optimized parts for laser cutting boxes :</p>
<p><img class="aligncenter" title="Box Docker" src="http://www.plixo.com.sg/software/screenshots/BoxDocker_1_01.png" alt="" width="238" height="419" /></p>
<p>Example of generated paths:<img title="Box Docker Generated Optimized Cutting Paths" src="http://www.plixo.com.sg/software/screenshots/PlixoBoxDockerGeneratedOptimized.png" alt="" width="448" height="272" /></p>
<p>See details and files for download in this very useful forum <a href="http://forum.oberonplace.com/showthread.php?t=24647">http://forum.oberonplace.com/showthread.php?t=24647</a></p>
<p>Let us know any comments either on the forum or by email at <a href="dev@plixo.com.sg">dev@plixo.com.sg</a>.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.plixo.com.sg/2013/12/coreldraw-add-on-for-laser-cutting-3d-parts/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CorelDraw VBA macro to detect &#8220;holes&#8221;, very useful for laser cutting complex shapes</title>
		<link>https://blog.plixo.com.sg/2011/10/coreldraw-vba-macro-to-detect-holes-very-useful-for-laser-cutting-complex-shapes</link>
		<comments>https://blog.plixo.com.sg/2011/10/coreldraw-vba-macro-to-detect-holes-very-useful-for-laser-cutting-complex-shapes#comments</comments>
		<pubDate>Thu, 06 Oct 2011 18:56:38 +0000</pubDate>
		<dc:creator>plixo</dc:creator>
				<category><![CDATA[CorelDraw Macros]]></category>
		<category><![CDATA[Laser Cutting & Engraving Services]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[CorelDraw]]></category>
		<category><![CDATA[laser cutting]]></category>
		<category><![CDATA[macro]]></category>
		<category><![CDATA[VBA]]></category>

		<guid isPermaLink="false">http://blog.plixo.com.sg/?p=182</guid>
		<description><![CDATA[For the last two years, we have manually checked and amended customers drawing sto ensure we cut the parts in the right order, i.e. the inside 1st. Typical example is with letters like O, g, e etc. I finally decided &#8230; <a href="https://blog.plixo.com.sg/2011/10/coreldraw-vba-macro-to-detect-holes-very-useful-for-laser-cutting-complex-shapes">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>For the last two years, we have manually checked and amended customers drawing sto ensure we cut the parts in the right order, i.e. the inside 1st.<br />
Typical example is with letters like O, g, e etc.</p>
<p>I finally decided to tackle this issue to optimize productivity, reduce manual errors and allow our team to do more value-added of their precious time.</p>
<p>Good thing with CorelDraw is you can program your own macros in VBA, quite extensive sets of objects, pethods and properties, and reasonable performance.<br />
Looking over internet, I found I was not the only one searching for this, but only a few full commercial solution were available.</p>
<p>So I coded it myself. Find below my 1st attempt.<br />
Seems to work OK for only one level of inside shapes [by design] .<br />
Will improve it when get more free time since most of our case are one level only so should solve the issue of my operator in 95% of the cases.</p>
<p>Here is an example: <a href="http://blog.plixo.com.sg/wp-content/uploads/2011/10/OutlineInsideCurves3.jpg"><img class="aligncenter size-large wp-image-190" title="OutlineInsideCurves" src="http://blog.plixo.com.sg/wp-content/uploads/2011/10/OutlineInsideCurves3-1024x649.jpg" alt="" width="640" height="405" /></a><a href="http://blog.plixo.com.sg/wp-content/uploads/2011/10/OutlineInsideCurves.jpg"><br />
</a></p>
<p>The main steps are:<br />
1st stage:<br />
- ungroup<br />
- convert to curves<br />
- break apart</p>
<p>2nd stage:<br />
- parse all shapes and check if they intersect with eachother. If they intersect then either their intersection is equal to one of them i.e. this one is the fully included i.e. the hole, or the opposite, or it&#8217;s a real intersect that I don&#8217;t handle for now</p>
<p>3rd stage:<br />
- in my case I change the outline color since this is used by the laser cutter to determine the order. Feel free to change to your own need.</p>
<p>Minimal error checking, no user interface for now.</p>
<p>Code:<br />
<em>Private Function POutlineInsideCurves(rangeToParse As ShapeRange, insideColor As Color) As ShapeRange</em></p>
<p><em> </em></p>
<p><em> Dim s As Shape<br />
Dim ss As Shape<br />
Dim si As Shape<br />
Dim sBreak As ShapeRange</em></p>
<p><em> </em></p>
<p><em> Dim sCurves As New ShapeRange<br />
Dim results As New ShapeRange</em></p>
<p><em> </em></p>
<p><em> Dim i As Integer<br />
Dim j As Integer<br />
Dim count As Integer</em></p>
<p><em>&#8216;Ungroup all 1st<br />
Set rangeToParse = rangeToParse.UngroupAllEx</em></p>
<p><em>&#8216; Parse all shapes, put them as curves and break them<br />
For Each s In rangeToParse<br />
Select Case s.Type<br />
Case cdrCurveShape<br />
Case cdrRectangleShape, cdrEllipseShape<br />
s.ConvertToCurves<br />
Case cdrTextShape<br />
s.ConvertToCurves<br />
Case Else<br />
&#8216; Should raise an error and display error message here<br />
End Select</em></p>
<p><em>Set sBreak = s.BreakApartEx<br />
sCurves.AddRange sBreak<br />
Next s</em></p>
<p><em>&#8216; Parse all broken shapes and find which are insides<br />
count = sCurves.count</p>
<p>For i = 1 To count<br />
Set s = sCurves(i)</p>
<p>s.Fill.ApplyNoFill</p>
<p>For j = i + 1 To count<br />
Set ss = sCurves(j)</p>
<p>Set si = s.Intersect(ss, True, True)</p>
<p>If si Is Nothing Then<br />
&#8216; Nothing to do, no intersect<br />
Else<br />
If si.Curve.Area = s.Curve.Area Then<br />
results.Add s<br />
Else<br />
If si.Curve.Area = ss.Curve.Area Then<br />
results.Add ss<br />
Else<br />
&#8216; objects partial overlap so should display error message since can&#8217;t easily handle this case, for now just skip it<br />
End If<br />
End If<br />
si.Delete<br />
End If<br />
Next j<br />
Next i</p>
<p>&#8216; Parse all inside curves and change colors of them<br />
For Each s In results<br />
s.Outline.SetProperties -1, , insideColor<br />
s.OrderToFront<br />
Next s</p>
<p>Set POutlineInsideCurves = results</p>
<p>End Function</p>
<p>Public Sub OutlineInsideCurves()</p>
<p>Dim saveUnit As cdrUnit<br />
Dim saveOptimizeState As Boolean</p>
<p>Dim slanted As Boolean<br />
Dim Spacing As Double</p>
<p>Dim insideColor As Color<br />
Dim sr As ShapeRange</p>
<p>saveOptimizeState = Application.Optimization<br />
saveUnit = ActiveDocument.Unit<br />
Application.Optimization = True</p>
<p>On Error GoTo cleanState</p>
<p>ActiveDocument.BeginCommandGroup &#8220;Outline Inside Curves&#8221;</p>
<p>Set insideColor = CreateRGBColor(0, 255, 0)</p>
<p>Set sr = POutlineInsideCurves(ActiveSelectionRange, insideColor)</p>
<p>cleanState:<br />
ActiveDocument.EndCommandGroup<br />
ActiveDocument.Unit = saveUnit<br />
Application.Optimization = saveOptimizeState<br />
ActiveWindow.Refresh</p>
<p></em></p>
<p><em> </em></p>
<p><em> </em></p>
<p><em> </em></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><em>End Sub<br />
</em></p>
<p>Actually, I&#8217;ve started writing a few extra macros, greatly inspired by the fantastic job of Alex and James [will let you find who they are <img src='https://blog.plixo.com.sg/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> ]</p>
<p>The plan is to distribute these macros for free when we will have a full set of them, and work on doing improved/faster one in C/C++ for professional use and sell them for a fee + include them with a line of laser cutter we hope to design in the next years, most probably based on an opensource design greatly scaled up ;-:</p>
<p>Alexis Martial<br />
Managing Director and Crazy Encoder, Plixo</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.plixo.com.sg/2011/10/coreldraw-vba-macro-to-detect-holes-very-useful-for-laser-cutting-complex-shapes/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
