{"id":5193,"date":"2019-08-01T18:19:01","date_gmt":"2019-08-01T16:19:01","guid":{"rendered":"https:\/\/cadbooster.com\/?p=5193"},"modified":"2025-07-28T20:50:47","modified_gmt":"2025-07-28T18:50:47","slug":"complete-overview-of-matrix-transformations-in-the-solidworks-api","status":"publish","type":"post","link":"https:\/\/cadbooster.com\/nl\/complete-overview-of-matrix-transformations-in-the-solidworks-api\/","title":{"rendered":"A complete overview of matrix transformations in the SOLIDWORKS API"},"content":{"rendered":"<p>I&#8217;ve been struggling with transformations for a few days now.<\/p>\n<p>And I really needed this post. But it didn&#8217;t exist.<\/p>\n<p>So I am writing it now.<\/p>\n<p>If you are having trouble too, this post is for you.<\/p>\n<h3>Within this post, you\u2019ll find\u2026<\/h3>\n<ol>\n<li><a href=\"#what-is-a-matrix\">Matrices are everywhere in SOLIDWORKS (+what is a matrix)<\/a><\/li>\n<li><a href=\"#about-matrix-transformations\">Matrix transformations: the basics\u00a0<\/a><\/li>\n<li><a href=\"#matrix-transformations-solidworks\">Matrix transformations in SOLIDWORKS<\/a><\/li>\n<li><a href=\"#spaces-model-space-view-space\">9 spaces: model space \/ view space \/ sheet space<\/a><\/li>\n<li><a href=\"#available-transformations-solidworks\">Available transformation matrices within SOLIDWORKS<\/a><\/li>\n<li><a href=\"#when-do-I-need-which-transformation\">When do I need which transformation?<\/a><\/li>\n<li><a href=\"#conclusion\">Conclusion: transformations are everywhere<\/a><\/li>\n<li><a href=\"#useful-macros\">Useful macros<\/a><\/li>\n<li><a href=\"#useful-forum-topics\">Useful forum topics<\/a><\/li>\n<li><a href=\"#how-you-can-help\">How you can help to make this article even better<\/a><\/li>\n<\/ol>\n<h3 id=\"what-is-a-matrix\" class=\"anchor\">1. Matrices are everywhere in SOLIDWORKS<\/h3>\n<h4>What&#8217;s a matrix?<\/h4>\n<p>If you have no idea what a matrix is, then I might have to disappoint you.<\/p>\n<p>We are not going to talk about Neo today (although you might want to check out <a href=\"https:\/\/www.youtube.com\/watch?v=8vrkF-nzht8\">this<\/a> cool behind the scenes video).<\/p>\n<p>We&#8217;re talking about these things:<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-5194\" src=\"https:\/\/cadbooster.com\/wp-content\/uploads\/2019\/07\/044-01-matrix-definition.png\" alt=\"solidworks matrix \" width=\"142\" height=\"52\" \/><\/p>\n<p>The matrix above has two rows and three columns. A matrix with three rows and one column (called a column vector or column matrix) is used to describe a point in 3D.<\/p>\n<p>It&#8217;s basically an arrow from the origin to this point. It has a direction and a length.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-5196\" src=\"https:\/\/cadbooster.com\/wp-content\/uploads\/2019\/07\/044-02-column-vector-solidworks.png\" alt=\"column vector solidworks\" width=\"45\" height=\"73\" \/><\/p>\n<h4>What are transformations?<\/h4>\n<p>When you multiply a 3&#215;3 matrix with a 3&#215;1 (3 rows, 1 column) vector, the result is another 3&#215;1 vector with a different direction. This is called a <strong>transformation<\/strong>.<\/p>\n<p>The length of the vector stays the same when you only change the orientation.<\/p>\n<h4>How matrices are used in SOLIDWORKS<\/h4>\n<p>Everything SOLIDWORKS does uses matrices:<\/p>\n<ul>\n<li>Every 3D point has three coordinates<\/li>\n<li>Each sketch plane uses its own coordinate system. Check out the coordinates systems on the bottom left, in a sketch on the front plane (left) and on the right plane (right). SOLIDWORKS uses transformations to translate between the coordinate system of the part of the coordinate system of the sketch.<\/li>\n<\/ul>\n<p><img decoding=\"async\" class=\"alignnone wp-image-5202 size-full\" src=\"https:\/\/cadbooster.com\/wp-content\/uploads\/2019\/07\/044-03-sketch-on-front-right-plane.png\" alt=\"sketch transformations for front and right plane\" width=\"1000\" height=\"325\" srcset=\"https:\/\/cadbooster.com\/wp-content\/uploads\/2019\/07\/044-03-sketch-on-front-right-plane.png 1000w, https:\/\/cadbooster.com\/wp-content\/uploads\/2019\/07\/044-03-sketch-on-front-right-plane-300x98.png 300w, https:\/\/cadbooster.com\/wp-content\/uploads\/2019\/07\/044-03-sketch-on-front-right-plane-768x250.png 768w\" sizes=\"(max-width: 1000px) 100vw, 1000px\" \/><\/p>\n<ul>\n<li>Every mate creates a row and a column in the mate matrix of the assembly. SOLIDWORKS then solves (simplifies) this matrix to find all component positions every time you make a change, drag a component or do a rebuild.<\/li>\n<li>Components in an assembly have a transformation matrix that determines their orientation.<\/li>\n<li>A drawing sheet has its origin at the bottom left, but each view is oriented differently. As I wrote before, <a href=\"https:\/\/cadbooster.com\/drawings-assemblies-mind-blown\/\">drawings are basically assemblies<\/a>, and every drawing view has a transformation as well.<\/li>\n<li>Every coordinate system that you add has its own transformation matrix.<\/li>\n<li>Each pattern instance has its own transformation<\/li>\n<li>I almost forgot the most visible one: when you rotate your model, all you do is update the transformation matrix. Then SOLIDWORKS calculates which points and faces should be made visible.<\/li>\n<\/ul>\n<h3 id=\"about-matrix-transformations\" class=\"anchor\">2. Matrix transformations: the basics<\/h3>\n<p>If you already know how matrix multiplication works, you can <a href=\"#matrix-transformations-solidworks\">skip ahead<\/a> to the next section.<\/p>\n<h4>Translate \/ move<\/h4>\n<p>Translating a point is pretty simple to do. Just add two column vectors to get the sum.<\/p>\n<p>You can only sum matrices of the same size. Each element is the sum of the element in the parts, for example 1+4 = 5.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-5225\" src=\"https:\/\/cadbooster.com\/wp-content\/uploads\/2019\/08\/044-10-solidworks-matrix-translation-sum.png\" alt=\"solidworks matrix translation sum\" width=\"167\" height=\"78\" \/><\/p>\n<p>You can visualize summing vectors by stacking two arrows. The sum is the endpoint of the top arrow.<\/p>\n<p>(The image below does not use the same values as the example above by the way)<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-5227\" src=\"https:\/\/cadbooster.com\/wp-content\/uploads\/2019\/08\/044-11-vector-translate-sum.png\" alt=\"vector translate sum\" width=\"253\" height=\"215\" \/><\/p>\n<h4>Rotate in 2D<\/h4>\n<p>I can best start explaining rotation matrices in 2D.<\/p>\n<p>To rotate a x,y vector with angle theta, you multiply the vector with a rotation matrix:<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-5231\" src=\"https:\/\/cadbooster.com\/wp-content\/uploads\/2019\/08\/044-12-rotation-matrix-2D-1.png\" alt=\"rotation matrix 2D\" width=\"229\" height=\"208\" \/><\/p>\n<p><a href=\"https:\/\/www.wolframalpha.com\/\">Wolfram Alpha<\/a> is nice enough to also show how you can manually calculate the X and Y values of the rotated point.<\/p>\n<p>To calculate the X value (the first row), multiply each element in the first row of the matrix by the first column of the original point. Then you sum the results.<\/p>\n<p>To calculate Y (the second row), multiply each element in the second row of the matrix with the first row of the vector. Then sum them again.<\/p>\n<p>&nbsp;<\/p>\n<p>I also found this example on <a href=\"https:\/\/math.stackexchange.com\/questions\/363652\/understanding-rotation-matrices\">StackExchange<\/a>, which nicely visualizes rotating a square:<\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-5233\" src=\"https:\/\/cadbooster.com\/wp-content\/uploads\/2019\/08\/044-13-rotation-matrix-2d.jpg\" alt=\"transformations: rotation matrix 2D\" width=\"676\" height=\"526\" srcset=\"https:\/\/cadbooster.com\/wp-content\/uploads\/2019\/08\/044-13-rotation-matrix-2d.jpg 934w, https:\/\/cadbooster.com\/wp-content\/uploads\/2019\/08\/044-13-rotation-matrix-2d-300x234.jpg 300w, https:\/\/cadbooster.com\/wp-content\/uploads\/2019\/08\/044-13-rotation-matrix-2d-768x598.jpg 768w\" sizes=\"(max-width: 676px) 100vw, 676px\" \/><\/p>\n<h4>Rotate in 3D<\/h4>\n<p>Rotations around an axis in 3D use the same rotation matrix as in 2D, but with an added row and column.<\/p>\n<p>When you rotate something around the X-axis, the X-value remains the same. That&#8217;s why the first entry is one and all other values in that row and column are zero.<\/p>\n<p>You see the same pattern for rotations around Y and Z. Sometimes the sign for the sine is flipped though:<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-5236\" src=\"https:\/\/cadbooster.com\/wp-content\/uploads\/2019\/08\/044-12-rotation-matrix-3D.png\" alt=\"rotation matrix 3D\" width=\"223\" height=\"261\" \/><\/p>\n<p>Image source: <a href=\"https:\/\/en.wikipedia.org\/wiki\/Rotation_matrix\">Wikipedia<\/a><\/p>\n<h4>When the rotation is in the wrong direction<\/h4>\n<p>I have been coming back to this post for help regularly. Yesterday I noticed my 90-degree rotation around Z gave negative values for the sin(theta) values.<\/p>\n<p>It turns out that there is a difference between the matrix to <strong>transform a point from X to X&#8217;<\/strong> is different than the matrix to <strong>transform the coordinate system R3 to R3&#8242;.<\/strong><\/p>\n<p>So there is no need to be alarmed. Just be aware.<\/p>\n<p>Source: <a href=\"https:\/\/mathworld.wolfram.com\/RotationMatrix.html\">Wolfram Mathworld<\/a>, equation 3-6<\/p>\n<h4>\u00a0Scale<\/h4>\n<p>To scale a point with regards to the origin, all you need to do is multiply each value by the scale.<\/p>\n<p>That&#8217;s it!<\/p>\n<p>Or if you want to use a complete matrix to scale equally in all directions:<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-5238\" src=\"https:\/\/cadbooster.com\/wp-content\/uploads\/2019\/08\/044-014-scale-matrix.png\" alt=\"scale matrix\" width=\"206\" height=\"69\" \/><\/p>\n<h4>Doing manual calculations and checks<\/h4>\n<p>The nice thing about 2D and 3D transformations is that you can do the calculations manually on paper as well.<\/p>\n<p>But you can also use the awesome site <a href=\"https:\/\/www.wolframalpha.com\/\">Wolfram Alpha<\/a>.<\/p>\n<h3 id=\"matrix-transformations-solidworks\" class=\"anchor\">3. Matrix transformations in SOLIDWORKS<\/h3>\n<p>SOLIDWORKS uses 4&#215;4 matrices to define transformations. They call it a <a href=\"https:\/\/help.solidworks.com\/2022\/english\/api\/sldworksapi\/SOLIDWORKS.Interop.sldworks~SOLIDWORKS.Interop.sldworks.IMathTransform.html\">MathTransform<\/a>.<\/p>\n<p>It&#8217;s built up out of four sections:<\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-5205 size-full\" src=\"https:\/\/cadbooster.com\/wp-content\/uploads\/2019\/07\/044-04-IMathTransform-MathTransform-transformation-SOLIDWORKS.png\" alt=\"transformations transformation matrix SOLIDWORKS (IMathTransform)\" width=\"264\" height=\"108\" \/><\/p>\n<p>Not used means these values are always zero. The same matrix structure is used in Microsoft .NET <a href=\"https:\/\/docs.microsoft.com\/en-us\/dotnet\/api\/system.windows.media.media3d.matrix3d?view=netframework-4.8\">Matrix3D<\/a> for 3D graphics.<\/p>\n<p>Note that SOLIDWORKS names the elements per submatrix. It <strong>always<\/strong> uses this custom order, for example when it returns 16 elements as <a href=\"https:\/\/help.solidworks.com\/2022\/english\/api\/sldworksapi\/SolidWorks.Interop.sldworks~SolidWorks.Interop.sldworks.IMathTransform~ArrayData.html\">ArrayData<\/a>:<\/p>\n<ul>\n<li>0-8 \/\u00a0 a-i \/ rotation submatrix<\/li>\n<li>9-11 \/ j-l \/ translation vector<\/li>\n<li>12 \/ m \/ scaling factor<\/li>\n<li>13-15 \/ n-p \/ not used<\/li>\n<\/ul>\n<p>Combined, this matrix creates an <a href=\"https:\/\/en.wikipedia.org\/wiki\/Affine_transformation\">affine transformation<\/a>. This basically means that, when you multiply multiple objects with the same transformation, relations between points remains the same and parallel lines and planes remain parallel.<\/p>\n<p>When you do manual calculations, multiply the vector by the rotation first, then scale the result, then translate that result.<\/p>\n<h4>Rotation matrix<\/h4>\n<p>To rotate a point (or any other object) around the origin (and keep the scale and the distance to the origin the same), set the values a-i and set the scale to 1:<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-5209\" src=\"https:\/\/cadbooster.com\/wp-content\/uploads\/2019\/07\/044-06-rotation-matrixy.png\" alt=\"rotation matrix solidworks\" width=\"119\" height=\"114\" \/><\/p>\n<p>You can think of each row in these matrices as the direction of an axis. Check out the helpful image that I made below.<\/p>\n<p>The front view uses the standard coordinate system. The top view has the X-axis in the same direction, whereas the right view has the X-axis in Z-direction.<\/p>\n<p>You can also see that the Z-axis in the top view is in the negative Y direction of the front view.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-5250\" src=\"https:\/\/cadbooster.com\/wp-content\/uploads\/2019\/08\/044-15-front-view-top-view-transformation-matrix.png\" alt=\"front view top view transformations matrix\" width=\"240\" height=\"177\" \/><\/p>\n<p>That should make these rotation matrices a little easier to read.<\/p>\n<div style=\"margin: 40px 0; text-align: center; display: block; background-color: #f8f8f8; user-select: none; justify-content: center; border: 3px solid #2ac819; border-radius: 5px;\">\r\n<h2 style=\"color: #363636; font-size: 45px; margin: 20px 0 0 0;\">Ditch the Toolbox, once and for all<\/h2>\r\n<span class=\"subtitle\">Start using the fastener library that actually follows the standards<\/span>\r\n<div style=\"margin: 20px;\"><img decoding=\"async\" class=\"alignnone size-full wp-image-12394\" src=\"https:\/\/cadbooster.com\/wp-content\/uploads\/2023\/02\/Fastener-models-banner-1000x114-1.png\" alt=\"\" width=\"800\" height=\"91\" srcset=\"https:\/\/cadbooster.com\/wp-content\/uploads\/2023\/02\/Fastener-models-banner-1000x114-1.png 1000w, https:\/\/cadbooster.com\/wp-content\/uploads\/2023\/02\/Fastener-models-banner-1000x114-1-300x34.png 300w, https:\/\/cadbooster.com\/wp-content\/uploads\/2023\/02\/Fastener-models-banner-1000x114-1-768x88.png 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/div>\r\n<div style=\"display: flex; flex-direction: row; padding: 10px;\">\r\n<div style=\"width: 33%; display: flex; justify-content: center;\">\r\n<ul class=\"check check_fastener_models\" style=\"color: #363636; text-align: left; margin-bottom: 0px;\">\r\n<li>No more mate errors<\/li>\r\n<\/ul>\r\n<\/div>\r\n<div style=\"width: 33%; display: flex; justify-content: center;\">\r\n<ul class=\"check check_fastener_models\" style=\"color: #363636; text-align: left; margin-bottom: 0px;\">\r\n<li>Made for speed<\/li>\r\n<\/ul>\r\n<\/div>\r\n<div style=\"width: 33%; display: flex; justify-content: center;\">\r\n<ul class=\"check check_fastener_models\" style=\"color: #363636; text-align: left; margin-bottom: 0px;\">\r\n<li>No yearly license fees<\/li>\r\n<\/ul>\r\n<\/div>\r\n<\/div>\r\n<div style=\"margin-bottom: 20px;\"><a id=\"drew-banner-confirm\" class=\" shortcode_button btn_small btn_type1 fastener_models_button\" href=\"\/fastener-models\/\" target=\"_blank\" rel=\"noopener noreferrer\">Show me how<\/a><\/div>\r\n<\/div>\n<h4>Translation matrix\/move<\/h4>\n<p>To translate a point in 3D space and keep the orientation and the scale constant, set the rotation matrix to the <a href=\"https:\/\/en.wikipedia.org\/wiki\/Matrix_(mathematics)#Identity_matrix\">identity matrix<\/a> and the scale to 1.<\/p>\n<p>When you multiply a point with this matrix, the point moves <strong>j<\/strong> in the x-direction, <strong>k<\/strong> in the y-direction and <strong>l<\/strong> in the z-direction.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-5207\" src=\"https:\/\/cadbooster.com\/wp-content\/uploads\/2019\/07\/044-05-translation-matrix.png\" alt=\"\" width=\"119\" height=\"114\" \/><\/p>\n<h4>Scale matrix<\/h4>\n<p>To scale a point position with a factor of two, only set the scale factor.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-5212\" src=\"https:\/\/cadbooster.com\/wp-content\/uploads\/2019\/07\/044-07-scale-matrix.png\" alt=\"scale matrix solidworks\" width=\"119\" height=\"114\" \/><\/p>\n<h4>Matrix inverse<\/h4>\n<p>You need to use the <em>matrix inverse<\/em> to create a transformation in the other direction.<\/p>\n<p>For example to go from view to model instead of model to view.<\/p>\n<p>When you already have a MathTransform, you can use <a href=\"https:\/\/help.solidworks.com\/2022\/english\/api\/sldworksapi\/SolidWorks.Interop.sldworks~SolidWorks.Interop.sldworks.IMathTransform~Inverse.html\">Inverse<\/a> (to receive an object) or <a href=\"https:\/\/help.solidworks.com\/2022\/english\/api\/sldworksapi\/SolidWorks.Interop.sldworks~SolidWorks.Interop.sldworks.IMathTransform~IInverse.html\">IInverse<\/a> (to receive a MathTransform, which is a little more useful because you don&#8217;t have to cast it).<\/p>\n<p>These inverse matrices have some nice properties:<\/p>\n<ul>\n<li>For a pure rotation matrix, the sign of the rotation submatrix changes (see image below). The top left 1 does not create a rotation because it is on the diagonal, so this value is not inverted.<\/li>\n<li>For a pure translation matrix, all three values just have a minus sign in front of them<\/li>\n<li>For a scale matrix, the value is just 1 over the scale. So 2 turns into 0.5<\/li>\n<\/ul>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-5214\" src=\"https:\/\/cadbooster.com\/wp-content\/uploads\/2019\/07\/044-08-rotation-matrix-inverse.png\" alt=\"rotation matrix inverse\" width=\"328\" height=\"107\" srcset=\"https:\/\/cadbooster.com\/wp-content\/uploads\/2019\/07\/044-08-rotation-matrix-inverse.png 328w, https:\/\/cadbooster.com\/wp-content\/uploads\/2019\/07\/044-08-rotation-matrix-inverse-300x98.png 300w\" sizes=\"(max-width: 328px) 100vw, 328px\" \/><\/p>\n<h4>How to combine matrices<\/h4>\n<p>Combining a rotation, a translation and a scale is not a problem, just add all of the entries to a single matrix.<\/p>\n<p>But to combine two full matrices, you need to <strong>multiply<\/strong> them.<\/p>\n<p>When you multiply two square matrices, the result is a different (composite) square matrix with the same dimensions. You can use <a href=\"https:\/\/help.solidworks.com\/2016\/english\/api\/sldworksapi\/SolidWorks.Interop.sldworks~SolidWorks.Interop.sldworks.IMathTransform~Multiply.html\">MathTransform.Multiply<\/a> for that within SOLIDWORKS.<\/p>\n<p>According to the SOLIDWORKS support employee I asked for help, the multiplication order does not matter. <strong>I still don&#8217;t believe this.<\/strong><\/p>\n<p>One of the first things I learned about matrices is that the multiplication order is of paramount importance. So I decided to test it in SOLIDWORKS.<\/p>\n<h4>The matrix multiplication order matters<\/h4>\n<p>I created a rotation matrix for a top view (-90 degrees around X) and one for the right view (90 degrees around Y).<\/p>\n<p>Then I multiplied them: top.Multiply(right) and right.Multiply(top). The resulting matrix is not the same.<\/p>\n<div id=\"attachment_5220\" style=\"width: 730px\" class=\"wp-caption alignnone\"><img decoding=\"async\" aria-describedby=\"caption-attachment-5220\" class=\"wp-image-5220 size-full\" src=\"https:\/\/cadbooster.com\/wp-content\/uploads\/2019\/07\/044-09-matrix-multiplication-mathtransform-1.png\" alt=\"solidworks transformations matrix order matters!\" width=\"720\" height=\"515\" srcset=\"https:\/\/cadbooster.com\/wp-content\/uploads\/2019\/07\/044-09-matrix-multiplication-mathtransform-1.png 720w, https:\/\/cadbooster.com\/wp-content\/uploads\/2019\/07\/044-09-matrix-multiplication-mathtransform-1-300x215.png 300w\" sizes=\"(max-width: 720px) 100vw, 720px\" \/><p id=\"caption-attachment-5220\" class=\"wp-caption-text\">Rotation for top view * rotation for right view<\/p><\/div>\n<div id=\"attachment_5218\" style=\"width: 730px\" class=\"wp-caption alignnone\"><img decoding=\"async\" aria-describedby=\"caption-attachment-5218\" class=\"wp-image-5218 size-full\" src=\"https:\/\/cadbooster.com\/wp-content\/uploads\/2019\/07\/044-09-matrix-multiplication-mathtransform-2.png\" alt=\"solidworks transformations matrix order matters!\" width=\"720\" height=\"515\" srcset=\"https:\/\/cadbooster.com\/wp-content\/uploads\/2019\/07\/044-09-matrix-multiplication-mathtransform-2.png 720w, https:\/\/cadbooster.com\/wp-content\/uploads\/2019\/07\/044-09-matrix-multiplication-mathtransform-2-300x215.png 300w\" sizes=\"(max-width: 720px) 100vw, 720px\" \/><p id=\"caption-attachment-5218\" class=\"wp-caption-text\">Rotation for right view * rotation for top view<\/p><\/div>\n<p>I have also tested this within SOLIDWORKS with a point. <strong>Turns out the order is important after all.<\/strong><\/p>\n<p>So be careful with this.<\/p>\n<p>The multiplication order SOLIDWORKS uses is from left to right, just as you would read it:<\/p>\n<p>top.Multiply(right) equals doing [top]*[right].<\/p>\n<p>The SOLIDWORKS help does not state this anywhere though.<\/p>\n<h4>How to create matrix transformations in the SOLIDWORKS API<\/h4>\n<p>Here is a code example on how to create a MathTransform. I prefer to write in C#, but this is in VBA because that is still used by many.<\/p>\n<pre class=\"lang:vb decode:true\" title=\"Create a MathTransform\">Option Explicit\r\n\r\nSub CreateTransform()\r\n    Dim swApp As SldWorks.SldWorks\r\n    Dim mathUtility As mathUtility\r\n    Dim transform As MathTransform\r\n    \r\n    Set swApp = Application.SldWorks\r\n    Set mathUtility = swApp.GetMathUtility\r\n    \r\n    Dim xValue As Double, yValue As Double, zValue As Double\r\n    \r\n    Dim transformArray(15) As Double\r\n    'Rotation. Note that there are three assignment per line to shorten the macro\r\n    transformArray(0) = 1: transformArray(1) = 0: transformArray(2) = 0:\r\n    transformArray(3) = 0: transformArray(4) = 1: transformArray(5) = 0:\r\n    transformArray(6) = 0: transformArray(7) = 0: transformArray(8) = 1:\r\n    'Translation\r\n    transformArray(9) = xValue: transformArray(10) = yValue: transformArray(11) = zValue:\r\n    'Scale\r\n    transformArray(12) = 1\r\n    \r\n    Set transform = mathUtility.CreateTransform(transformArray)\r\n    \r\n    Dim transformData As Variant\r\n    transformData = transform.ArrayData\r\nEnd Sub<\/pre>\n<p>This code gets the <a href=\"https:\/\/help.solidworks.com\/2022\/english\/api\/sldworksapi\/SolidWorks.Interop.sldworks~SolidWorks.Interop.sldworks.IMathUtility.html\">MathUtility<\/a>, creates an array that contains the data, then creates a MathTransform from that array.<\/p>\n<p>You can verify the data using <a href=\"https:\/\/help.solidworks.com\/2022\/english\/api\/sldworksapi\/SolidWorks.Interop.sldworks~SolidWorks.Interop.sldworks.IMathTransform~ArrayData.html\">mathTransform.ArrayData<\/a>, which returns a double array with 16 numbers as a variant.<\/p>\n<p>If you don&#8217;t supply the correct number of doubles in the array (or if something else is wrong, more details <a href=\"https:\/\/help.solidworks.com\/2022\/english\/api\/sldworksapi\/SolidWorks.Interop.sldworks~SolidWorks.Interop.sldworks.IMathUtility~CreateTransform.html\">here<\/a>), SOLIDWORKS returns an identity matrix. So first check the matrix&#8217;s array data when something unexpected happens.<\/p>\n<h3 id=\"spaces-model-space-view-space\" class=\"anchor\">4. 9 spaces: model space \/ view space \/ sheet space<\/h3>\n<p>When you do something in the assembly or the part with regard to the origin, this is called Model space.<\/p>\n<p>A definition of a space would be a set of points, with a relation between those points. It basically says how the origin and the coordinate system is created in relation to another coordinate system.<\/p>\n<p>Here is a list of spaces that are used in SOLIDWORKS. The names are not officially defined anywhere though.<\/p>\n<ol>\n<li><strong>Model space<\/strong> &#8211; uses the default coordinate system in a part or assembly<\/li>\n<li><strong>Coordinate system space<\/strong> &#8211; created when you add an extra coordinate system to your part\/assembly.<\/li>\n<li><strong>Component space<\/strong> &#8211; for every component within an assembly. Also used in motion studies.<\/li>\n<li><strong>Sketch space<\/strong> &#8211; each sketch has its own origin (that often coincides with the model origin) and a rotation around the origin to define its space.<\/li>\n<li><strong>Sheet space<\/strong> &#8211; starts at the bottom left of a drawing sheet<\/li>\n<li><strong>View space<\/strong> &#8211; start at the origin of the view<\/li>\n<li><strong>View sketch space<\/strong> &#8211; each drawing view contains an underlying sketch. You can add sketch items and blocks to this sketch. When you move a view, these objects move as well.<\/li>\n<li><strong>Model View space<\/strong> &#8211; this is the section of your window that shows your model or drawing.<\/li>\n<li><strong>Window space<\/strong> &#8211; the total SOLIDWORKS window<\/li>\n<\/ol>\n<p>I&#8217;m trying to list all spaces that are used within SOLIDWORKS, so if you miss one, please <a href=\"https:\/\/cadbooster.com\/contact\/\">get in touch<\/a> and I&#8217;ll add it.<\/p>\n<p>Also contact us if I made a mistake anywhere in this post, which is pretty likely to happen&#8230;<\/p>\n<h3 id=\"available-transformations-solidworks\" class=\"anchor\">5. Available transformations within SOLIDWORKS<\/h3>\n<ul>\n<li>Blocks:\n<ul>\n<li><a href=\"https:\/\/help.solidworks.com\/2022\/english\/api\/sldworksapi\/SolidWorks.Interop.sldworks~SolidWorks.Interop.sldworks.ISketchBlockInstance~BlockToSketchTransform.html\">ISketchBlockInstance.BlockToSketchTransform<\/a><\/li>\n<\/ul>\n<\/li>\n<li>\u00a0Bodies:\n<ul>\n<li>Body move\/copy feature:\u00a0<a href=\"https:\/\/help.solidworks.com\/2022\/english\/api\/sldworksapi\/SolidWorks.Interop.sldworks~SolidWorks.Interop.sldworks.IMoveCopyBodyFeatureData_members.html?verRedirect=1\">IMoveCopyBodyFeatureData<\/a><\/li>\n<li><a href=\"https:\/\/help.solidworks.com\/2022\/english\/api\/sldworksapi\/SolidWorks.Interop.sldworks~SolidWorks.Interop.sldworks.IBody2~GetCoincidenceTransform2.html\">GetCoincidenceTransform2<\/a>\u00a0&#8211; Gets how a body should move to coincide with another body<\/li>\n<\/ul>\n<\/li>\n<li>Components:\n<ul>\n<li><a href=\"https:\/\/help.solidworks.com\/2022\/english\/api\/sldworksapi\/SolidWorks.Interop.sldworks~SolidWorks.Interop.sldworks.IComponent2~Transform2.html\">IComponent2.Transform2<\/a><\/li>\n<li><a href=\"https:\/\/help.solidworks.com\/2022\/english\/api\/sldworksapi\/SOLIDWORKS.Interop.sldworks~SOLIDWORKS.Interop.sldworks.IComponent2~PresentationTransform.html\">IComponent2.PresentationTransform<\/a>: used to move the component only visually, without affecting the geometry. Used in exploded views.<\/li>\n<li><a href=\"https:\/\/help.solidworks.com\/2022\/english\/api\/sldworksapi\/SOLIDWORKS.Interop.sldworks~SOLIDWORKS.Interop.sldworks.IComponent2~GetTotalTransform.html\">IComponent2.GetTotalTransform()<\/a>: gets the combination of the two properties above.<\/li>\n<li><a href=\"https:\/\/help.solidworks.com\/2022\/english\/api\/sldworksapi\/SolidWorks.Interop.sldworks~SolidWorks.Interop.sldworks.IComponent2~GetSpecificTransform.html\">IComponent2.GetSpecificTransform()<\/a>: gets the transform in exploded or collapsed state<\/li>\n<\/ul>\n<\/li>\n<li>Display dimensions:\n<ul>\n<li><a href=\"https:\/\/help.solidworks.com\/2022\/english\/api\/sldworksapi\/SolidWorks.Interop.sldworks~SolidWorks.Interop.sldworks.IDisplayDimension~GetDefinitionTransform.html\">IDisplayDimension.GetDefinitionTransform<\/a><\/li>\n<\/ul>\n<\/li>\n<li>Coordinate systems:\n<ul>\n<li><a href=\"https:\/\/help.solidworks.com\/2022\/english\/api\/sldworksapi\/SolidWorks.Interop.sldworks~SolidWorks.Interop.sldworks.ICoordinateSystemFeatureData~Transform.html\">ICoordinateSystemFeatureData.Transform<\/a><\/li>\n<\/ul>\n<\/li>\n<li>Patterns:\n<ul>\n<li><a href=\"https:\/\/help.solidworks.com\/2022\/english\/api\/sldworksapi\/SOLIDWORKS.Interop.sldworks~SOLIDWORKS.Interop.sldworks.ICircularPatternFeatureData~GetTransform.html\">ICircularPatternFeatureData.GetTransform()<\/a>: get the transform for an instance<\/li>\n<li><a href=\"https:\/\/help.solidworks.com\/2022\/english\/api\/sldworksapi\/SOLIDWORKS.Interop.sldworks~SOLIDWORKS.Interop.sldworks.ICurveDrivenPatternFeatureData~GetTransform.html\"> ICurveDrivenPatternFeatureData.GetTransform()<\/a>: instance transform<\/li>\n<li><a href=\"https:\/\/help.solidworks.com\/2022\/english\/api\/sldworksapi\/SOLIDWORKS.Interop.sldworks~SOLIDWORKS.Interop.sldworks.IDerivedPatternFeatureData~GetTransform.html\">IDerivedPatternFeatureData.GetTransform()<\/a>: instance transform<\/li>\n<li><a href=\"https:\/\/help.solidworks.com\/2022\/english\/api\/sldworksapi\/SOLIDWORKS.Interop.sldworks~SOLIDWORKS.Interop.sldworks.ILinearPatternFeatureData~GetTransform.html\">ILinearPatternFeatureData.GetTransform()<\/a>: instance transform<\/li>\n<li><a href=\"https:\/\/help.solidworks.com\/2022\/english\/api\/sldworksapi\/SolidWorks.Interop.sldworks~SolidWorks.Interop.sldworks.ISketchPatternFeatureData~GetTransform.html?verRedirect=1\">ISketchPatternFeatureData.GetTransform()<\/a>: instance transform<\/li>\n<li><a href=\"https:\/\/help.solidworks.com\/2022\/english\/api\/sldworksapi\/SOLIDWORKS.Interop.sldworks~SOLIDWORKS.Interop.sldworks.ISketchPatternFeatureData~GetTransform.html\">ITablePatternFeatureData.GetTransform()<\/a>: instance transform<\/li>\n<li><a href=\"https:\/\/help.solidworks.com\/2022\/english\/api\/sldworksapi\/SOLIDWORKS.Interop.sldworks~SOLIDWORKS.Interop.sldworks.IMirrorPartFeatureData~GetTransform.html\">IMirrorPartFeatureData.GetTransform()<\/a><\/li>\n<\/ul>\n<\/li>\n<li>ModelView:\n<ul>\n<li><a href=\"https:\/\/help.solidworks.com\/2022\/english\/api\/sldworksapi\/SolidWorks.Interop.sldworks~SolidWorks.Interop.sldworks.IModelView~Transform.html\">IModelView.Transform<\/a>: get the rotation for this model. Model does not have to be the active window. Use to convert model space to a position on the screen. I use the inverse to convert mouse coordinates to model space.<\/li>\n<li>Use <a href=\"https:\/\/help.solidworks.com\/2022\/english\/api\/sldworksapi\/SOLIDWORKS.Interop.sldworks~SOLIDWORKS.Interop.sldworks.IModelView~Orientation3.html\">IModelView.Orientation3<\/a> to get or set the orientation (pass an entire transformation matrix)<\/li>\n<li>Use <a href=\"https:\/\/help.solidworks.com\/2022\/english\/api\/sldworksapi\/SolidWorks.Interop.sldworks~SolidWorks.Interop.sldworks.IModelView~Translation3.html\">IModelView.Translation3<\/a> to get or set the translation (pass an entire transformation matrix)<\/li>\n<li>Use <a href=\"https:\/\/help.solidworks.com\/2022\/english\/api\/sldworksapi\/SolidWorks.Interop.sldworks~SolidWorks.Interop.sldworks.IModelView~GetViewHWndx64.html\">GetViewHWndx64<\/a> and <a href=\"https:\/\/www.pinvoke.net\/default.aspx\/user32.clienttoscreen\">ClientToScreen<\/a> to convert from model view coordinates (for example mouse coordinates) to window coordinates. See the bubble tooltip macro.<\/li>\n<\/ul>\n<\/li>\n<li>Reference planes:\n<ul>\n<li><a href=\"https:\/\/help.solidworks.com\/2022\/english\/api\/sldworksapi\/SOLIDWORKS.Interop.sldworks~SOLIDWORKS.Interop.sldworks.IRefPlane~Transform.html\">IRefPlane.Transform<\/a><\/li>\n<\/ul>\n<\/li>\n<li>Sketches:\n<ul>\n<li><a href=\"https:\/\/help.solidworks.com\/2022\/english\/api\/sldworksapi\/SolidWorks.Interop.sldworks~SolidWorks.Interop.sldworks.ISketch~ModelToSketchTransform.html\">ISketch.ModelToSketchTransform<\/a><\/li>\n<\/ul>\n<\/li>\n<li>Views:\n<ul>\n<li>These methods below return identical values, each in a different form:\n<ul>\n<li><a href=\"https:\/\/help.solidworks.com\/2022\/english\/api\/sldworksapi\/SolidWorks.Interop.sldworks~SolidWorks.Interop.sldworks.IView~ModelToViewTransform.html?verRedirect=1\">IView.ModelToViewTransform<\/a>: returns an actual MathTransform. When you pass the sheet as a view, this returns the identity matrix and 1:1 for the scale.<\/li>\n<li><a href=\"https:\/\/help.solidworks.com\/2022\/english\/api\/sldworksapi\/SolidWorks.Interop.sldworks~SolidWorks.Interop.sldworks.IView~GetXform.html?verRedirect=1\">IView.GetXform()<\/a>: returns 3 doubles that describe the x and y position of the view with regard to the sheet, plus the view scale<\/li>\n<li><a href=\"https:\/\/help.solidworks.com\/2022\/english\/api\/sldworksapi\/SolidWorks.Interop.sldworks~SolidWorks.Interop.sldworks.IView~GetViewXform.html\">IView.GetViewXform()<\/a>: returns 13 doubles (0-8 are rotation, 9-11 are translation, 12 is scale).<\/li>\n<\/ul>\n<\/li>\n<li><a href=\"https:\/\/help.solidworks.com\/2022\/english\/api\/sldworksapi\/SolidWorks.Interop.sldworks~SolidWorks.Interop.sldworks.IView~Position.html\">IView.Position<\/a>: Gets the position of the view center, which is <strong>not identical<\/strong> to the origin of the model in the model. The view position is just some random point in the middle of the view.<\/li>\n<li>IView.<a href=\"https:\/\/help.solidworks.com\/2022\/english\/api\/sldworksapi\/SolidWorks.Interop.sldworks~SolidWorks.Interop.sldworks.IView~GetSketch.html\">GetSketch()<\/a>.<a href=\"https:\/\/help.solidworks.com\/2022\/english\/api\/sldworksapi\/SolidWorks.Interop.sldworks~SolidWorks.Interop.sldworks.ISketch~ModelToSketchTransform.html\">ModelToSketchTransform<\/a>: sometimes needed to convert items within a view back to model space. When you pass the sheet as a view, this returns the identity matrix and (1\/sheet scale).<\/li>\n<\/ul>\n<\/li>\n<li>View3D (used for MBD):\n<ul>\n<li><a href=\"https:\/\/help.solidworks.com\/2022\/english\/api\/sldworksapi\/SolidWorks.Interop.sldworks~SolidWorks.Interop.sldworks.IView3D~Rotation.html\">IView3D.Rotation\u00a0<\/a><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>Did we miss a useful property or method here? <a href=\"https:\/\/cadbooster.com\/contact\/\">Get in touch<\/a> and we&#8217;ll add it.<\/p>\n<h4>Sheet scale transform?<\/h4>\n<p>I recently needed this matrix when converting view points in a drawing to model space (this matrix combined with ModelToSheetTransform actually).<\/p>\n<p>It only contains an identity matrix for the rotation, plus a value for the current scale. It got pointed out to me by Artem Taturevych on the SOLIDWORKS forums and it&#8217;s used in one of his <a href=\"https:\/\/www.codestack.net\/solidworks-api\/document\/drawing\/sheet-context-sketch\/\">examples<\/a> as well.<\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-5243 size-full\" src=\"https:\/\/cadbooster.com\/wp-content\/uploads\/2019\/08\/044-14-sheet-scale-transform.png\" alt=\"sheet scale transformations transformation\" width=\"113\" height=\"105\" \/><\/p>\n<p>So if you&#8217;re stuck and you only need to scale your object, this matrix might be the one you need.<\/p>\n<h3>Possible applications<\/h3>\n<ol>\n<li>Create a sketch within a view while using sheet coordinates (or sketch on the sheet using view coordinates).<\/li>\n<li>Adding a block along the edge of the sheet, while the block is linked to the view. Like we do automatically in <a href=\"https:\/\/cadbooster.com\/drew\/\">Drew<\/a>.<\/li>\n<li>Creating temporary bodies for previews and animations:\n<ol>\n<li><a href=\"https:\/\/www.codestack.net\/solidworks-api\/geometry\/body-rotate-animation\/\">Example by Artem<\/a><\/li>\n<li>Use <a href=\"https:\/\/help.solidworks.com\/2022\/english\/api\/sldworksapi\/SolidWorks.Interop.sldworks~SolidWorks.Interop.sldworks.IBody2~Copy2.html\">IBody2.Copy2()<\/a> to copy an existing body<\/li>\n<li>Apply a transformation to the new body with <a href=\"https:\/\/help.solidworks.com\/2022\/english\/api\/sldworksapi\/SolidWorks.Interop.sldworks~SolidWorks.Interop.sldworks.IBody2~ApplyTransform.html\">ApplyTransform()<\/a><\/li>\n<li>Call <a href=\"https:\/\/help.solidworks.com\/2022\/english\/api\/sldworksapi\/SolidWorks.Interop.sldworks~SolidWorks.Interop.sldworks.IBody2~Display3.html\">Display3()<\/a> to set the appearance<\/li>\n<li>You might need <a href=\"https:\/\/help.solidworks.com\/2022\/english\/api\/sldworksapi\/SolidWorks.Interop.sldworks~SolidWorks.Interop.sldworks.IModelView~GraphicsRedraw.html\">IModelView.GraphicsRedraw()<\/a> to make the body show up<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<h3 id=\"when-do-I-need-which-transformation\" class=\"anchor\">6. When do I need which transformation?<\/h3>\n<p>When you get the position of a point in a sketch, it&#8217;s pretty obvious that this point is in sketch space.<\/p>\n<p>To get back to model space, multiply the position with the inverse of ModeToSketchTransform. It&#8217;s that simple, usually.<\/p>\n<p>But there are more complex cases. I&#8217;ll be adding to this list when I find new situations or when you send me one:<\/p>\n<ul>\n<li>View entities to sheet coordinates:\n<ol>\n<li>Use GetVisibleComponents and GetVisibleEntities2 within a view to get all visible vertices or edges.<\/li>\n<li>Multiply with ModelToSketchTransform, then multiply with sheet scale transform to get model coordinates.<\/li>\n<li>Multiply this result by ModelToViewTransform to finally get sheet coordinates.<\/li>\n<li>(This took me three days to figure out&#8230; I really needed this post back then.)<\/li>\n<\/ol>\n<\/li>\n<li>The transformation between two coordinate systems:\n<ul>\n<li>I get this question often, so I thought I&#8217;d add it to the post.<\/li>\n<li>Each coordinate system has its own transformation matrix, with respect to the origin.<\/li>\n<li>So to go from one to the other, you need to go from one matrix to the origin (which requires the inverse of the matrix of that coordinate system), then multiply that with the matrix of the second coordinate system. Make sure that the order of the multiplication is correct.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h3 id=\"conclusion\" class=\"anchor\">7. Conclusion: Transformations are everywhere<\/h3>\n<p>The more I work with the SOLIDWORKS API, the more I run into transformations and their matrices.<\/p>\n<p>While developing our drawing automation tool <a href=\"https:\/\/cadbooster.com\/drew\/\">Drew<\/a>, I needed to scale, rotate and translate blocks. Right now I&#8217;m converting views and mouse coordinates to sheet space.<\/p>\n<p>I also created software for a client that creates thousands of motion studies. There, I rotated components, ran motion studies, then analyzed and compared the resulting orientations again. This was a major (and sometimes fun) exercise in transformation matrices.<\/p>\n<p>Yet I keep fighting with transformations. So I will probably read this post to solve my own problems in the near future.<\/p>\n<h3 id=\"useful-macros\" class=\"anchor\">8. Useful macros<\/h3>\n<ul>\n<li><a href=\"https:\/\/www.codestack.net\/solidworks-api\/document\/drawing\/sheet-context-sketch\/\">Draw sketch segments in context of the drawing sheet<\/a> &#8211; by Artem Taturevych &#8211; Shows you how to sketch a line in sheet space while using data from view space<\/li>\n<li><a href=\"https:\/\/www.codestack.net\/solidworks-api\/geometry\/transformation\/\">Using transforms<\/a> &#8211; introduction article with multiple example macros &#8211; by Artem Taturevych as well<\/li>\n<li><a href=\"https:\/\/forum.solidworks.com\/thread\/230296\">Draw bend hints for engraving onto sheet metal flat pattern<\/a> &#8211;\u00a0 by forum user Fifi Riri<\/li>\n<\/ul>\n<h3 id=\"useful-forum-topics\">9. Useful forum topics<\/h3>\n<ul>\n<li><a href=\"https:\/\/forum.solidworks.com\/thread\/105870\">Troubleshooting mathTransforms<\/a> &#8211; by John Alexander<\/li>\n<li><a href=\"https:\/\/forum.solidworks.com\/thread\/226218\">Add additional Note inside a Block<\/a> &#8211; by Adam Mircea<\/li>\n<\/ul>\n<h3 id=\"how-you-can-help\">10. Let&#8217;s make this post even better together<\/h3>\n<p>I called this post &#8220;A complete overview&#8221; and I mean it. But it&#8217;s not complete yet.<\/p>\n<p>So if you have a strange use case or a question that you would like to add to this post, <a href=\"https:\/\/cadbooster.com\/contact\/\">get in touch<\/a> so I can add it.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How do matrix transformations work? What is IMathTransform? We cover the basics + advanced topics. <\/p>\n","protected":false},"author":6,"featured_media":5246,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[214,213],"tags":[240,279,276,281],"class_list":["post-5193","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-solidworks-macros-en","category-solidworks-best-practices-en","tag-api","tag-imathtransform","tag-macro","tag-transformation"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.1 (Yoast SEO v27.6) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>A complete overview of matrix transformations in the SOLIDWORKS API<\/title>\n<meta name=\"description\" content=\"What is IMathTransform? How do matrix transformations work? Do I need ModelToViewTransform? We cover the basics + advanced topics.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/cadbooster.com\/complete-overview-of-matrix-transformations-in-the-solidworks-api\/\" \/>\n<meta property=\"og:locale\" content=\"nl_NL\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"A complete overview of matrix transformations in the SOLIDWORKS API\" \/>\n<meta property=\"og:description\" content=\"What is IMathTransform? How do matrix transformations work? Do I need ModelToViewTransform? We cover the basics + advanced topics.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/cadbooster.com\/complete-overview-of-matrix-transformations-in-the-solidworks-api\/\" \/>\n<meta property=\"og:site_name\" content=\"CAD Booster\" \/>\n<meta property=\"article:published_time\" content=\"2019-08-01T16:19:01+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-07-28T18:50:47+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cadbooster.com\/wp-content\/uploads\/2019\/08\/044-00-matrix-transformations-solidworks-IMathTransform.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1170\" \/>\n\t<meta property=\"og:image:height\" content=\"830\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Peter Brinkhuis\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Geschreven door\" \/>\n\t<meta name=\"twitter:data1\" content=\"Peter Brinkhuis\" \/>\n\t<meta name=\"twitter:label2\" content=\"Geschatte leestijd\" \/>\n\t<meta name=\"twitter:data2\" content=\"17 minuten\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/cadbooster.com\\\/complete-overview-of-matrix-transformations-in-the-solidworks-api\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/cadbooster.com\\\/complete-overview-of-matrix-transformations-in-the-solidworks-api\\\/\"},\"author\":{\"name\":\"Peter Brinkhuis\",\"@id\":\"https:\\\/\\\/cadbooster.com\\\/#\\\/schema\\\/person\\\/3e38034e2c654d4589df4fceba30b2ed\"},\"headline\":\"A complete overview of matrix transformations in the SOLIDWORKS API\",\"datePublished\":\"2019-08-01T16:19:01+00:00\",\"dateModified\":\"2025-07-28T18:50:47+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/cadbooster.com\\\/complete-overview-of-matrix-transformations-in-the-solidworks-api\\\/\"},\"wordCount\":2994,\"publisher\":{\"@id\":\"https:\\\/\\\/cadbooster.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/cadbooster.com\\\/complete-overview-of-matrix-transformations-in-the-solidworks-api\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/cadbooster.com\\\/wp-content\\\/uploads\\\/2019\\\/08\\\/044-00-matrix-transformations-solidworks-IMathTransform.jpg\",\"keywords\":[\"API\",\"IMathTransform\",\"macro\",\"transformation\"],\"articleSection\":[\"API \\\/ macros\",\"Best practices\"],\"inLanguage\":\"nl-NL\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/cadbooster.com\\\/complete-overview-of-matrix-transformations-in-the-solidworks-api\\\/\",\"url\":\"https:\\\/\\\/cadbooster.com\\\/complete-overview-of-matrix-transformations-in-the-solidworks-api\\\/\",\"name\":\"A complete overview of matrix transformations in the SOLIDWORKS API\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/cadbooster.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/cadbooster.com\\\/complete-overview-of-matrix-transformations-in-the-solidworks-api\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/cadbooster.com\\\/complete-overview-of-matrix-transformations-in-the-solidworks-api\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/cadbooster.com\\\/wp-content\\\/uploads\\\/2019\\\/08\\\/044-00-matrix-transformations-solidworks-IMathTransform.jpg\",\"datePublished\":\"2019-08-01T16:19:01+00:00\",\"dateModified\":\"2025-07-28T18:50:47+00:00\",\"description\":\"What is IMathTransform? How do matrix transformations work? Do I need ModelToViewTransform? We cover the basics + advanced topics.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/cadbooster.com\\\/complete-overview-of-matrix-transformations-in-the-solidworks-api\\\/#breadcrumb\"},\"inLanguage\":\"nl-NL\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/cadbooster.com\\\/complete-overview-of-matrix-transformations-in-the-solidworks-api\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"nl-NL\",\"@id\":\"https:\\\/\\\/cadbooster.com\\\/complete-overview-of-matrix-transformations-in-the-solidworks-api\\\/#primaryimage\",\"url\":\"https:\\\/\\\/cadbooster.com\\\/wp-content\\\/uploads\\\/2019\\\/08\\\/044-00-matrix-transformations-solidworks-IMathTransform.jpg\",\"contentUrl\":\"https:\\\/\\\/cadbooster.com\\\/wp-content\\\/uploads\\\/2019\\\/08\\\/044-00-matrix-transformations-solidworks-IMathTransform.jpg\",\"width\":1170,\"height\":830,\"caption\":\"matrix transformations solidworks IMathTransform\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/cadbooster.com\\\/complete-overview-of-matrix-transformations-in-the-solidworks-api\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/cadbooster.com\\\/nl\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"A complete overview of matrix transformations in the SOLIDWORKS API\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/cadbooster.com\\\/#website\",\"url\":\"https:\\\/\\\/cadbooster.com\\\/\",\"name\":\"CAD Booster\",\"description\":\"SOLIDWORKS AUTOMATION\",\"publisher\":{\"@id\":\"https:\\\/\\\/cadbooster.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/cadbooster.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"nl-NL\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/cadbooster.com\\\/#organization\",\"name\":\"CAD Booster\",\"url\":\"https:\\\/\\\/cadbooster.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"nl-NL\",\"@id\":\"https:\\\/\\\/cadbooster.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/cadbooster.com\\\/wp-content\\\/uploads\\\/2016\\\/11\\\/logo-CAD-Booster.png\",\"contentUrl\":\"https:\\\/\\\/cadbooster.com\\\/wp-content\\\/uploads\\\/2016\\\/11\\\/logo-CAD-Booster.png\",\"width\":1732,\"height\":964,\"caption\":\"CAD Booster\"},\"image\":{\"@id\":\"https:\\\/\\\/cadbooster.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/cadbooster.com\\\/#\\\/schema\\\/person\\\/3e38034e2c654d4589df4fceba30b2ed\",\"name\":\"Peter Brinkhuis\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"A complete overview of matrix transformations in the SOLIDWORKS API","description":"What is IMathTransform? How do matrix transformations work? Do I need ModelToViewTransform? We cover the basics + advanced topics.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/cadbooster.com\/complete-overview-of-matrix-transformations-in-the-solidworks-api\/","og_locale":"nl_NL","og_type":"article","og_title":"A complete overview of matrix transformations in the SOLIDWORKS API","og_description":"What is IMathTransform? How do matrix transformations work? Do I need ModelToViewTransform? We cover the basics + advanced topics.","og_url":"https:\/\/cadbooster.com\/complete-overview-of-matrix-transformations-in-the-solidworks-api\/","og_site_name":"CAD Booster","article_published_time":"2019-08-01T16:19:01+00:00","article_modified_time":"2025-07-28T18:50:47+00:00","og_image":[{"width":1170,"height":830,"url":"https:\/\/cadbooster.com\/wp-content\/uploads\/2019\/08\/044-00-matrix-transformations-solidworks-IMathTransform.jpg","type":"image\/jpeg"}],"author":"Peter Brinkhuis","twitter_card":"summary_large_image","twitter_misc":{"Geschreven door":"Peter Brinkhuis","Geschatte leestijd":"17 minuten"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/cadbooster.com\/complete-overview-of-matrix-transformations-in-the-solidworks-api\/#article","isPartOf":{"@id":"https:\/\/cadbooster.com\/complete-overview-of-matrix-transformations-in-the-solidworks-api\/"},"author":{"name":"Peter Brinkhuis","@id":"https:\/\/cadbooster.com\/#\/schema\/person\/3e38034e2c654d4589df4fceba30b2ed"},"headline":"A complete overview of matrix transformations in the SOLIDWORKS API","datePublished":"2019-08-01T16:19:01+00:00","dateModified":"2025-07-28T18:50:47+00:00","mainEntityOfPage":{"@id":"https:\/\/cadbooster.com\/complete-overview-of-matrix-transformations-in-the-solidworks-api\/"},"wordCount":2994,"publisher":{"@id":"https:\/\/cadbooster.com\/#organization"},"image":{"@id":"https:\/\/cadbooster.com\/complete-overview-of-matrix-transformations-in-the-solidworks-api\/#primaryimage"},"thumbnailUrl":"https:\/\/cadbooster.com\/wp-content\/uploads\/2019\/08\/044-00-matrix-transformations-solidworks-IMathTransform.jpg","keywords":["API","IMathTransform","macro","transformation"],"articleSection":["API \/ macros","Best practices"],"inLanguage":"nl-NL"},{"@type":"WebPage","@id":"https:\/\/cadbooster.com\/complete-overview-of-matrix-transformations-in-the-solidworks-api\/","url":"https:\/\/cadbooster.com\/complete-overview-of-matrix-transformations-in-the-solidworks-api\/","name":"A complete overview of matrix transformations in the SOLIDWORKS API","isPartOf":{"@id":"https:\/\/cadbooster.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/cadbooster.com\/complete-overview-of-matrix-transformations-in-the-solidworks-api\/#primaryimage"},"image":{"@id":"https:\/\/cadbooster.com\/complete-overview-of-matrix-transformations-in-the-solidworks-api\/#primaryimage"},"thumbnailUrl":"https:\/\/cadbooster.com\/wp-content\/uploads\/2019\/08\/044-00-matrix-transformations-solidworks-IMathTransform.jpg","datePublished":"2019-08-01T16:19:01+00:00","dateModified":"2025-07-28T18:50:47+00:00","description":"What is IMathTransform? How do matrix transformations work? Do I need ModelToViewTransform? We cover the basics + advanced topics.","breadcrumb":{"@id":"https:\/\/cadbooster.com\/complete-overview-of-matrix-transformations-in-the-solidworks-api\/#breadcrumb"},"inLanguage":"nl-NL","potentialAction":[{"@type":"ReadAction","target":["https:\/\/cadbooster.com\/complete-overview-of-matrix-transformations-in-the-solidworks-api\/"]}]},{"@type":"ImageObject","inLanguage":"nl-NL","@id":"https:\/\/cadbooster.com\/complete-overview-of-matrix-transformations-in-the-solidworks-api\/#primaryimage","url":"https:\/\/cadbooster.com\/wp-content\/uploads\/2019\/08\/044-00-matrix-transformations-solidworks-IMathTransform.jpg","contentUrl":"https:\/\/cadbooster.com\/wp-content\/uploads\/2019\/08\/044-00-matrix-transformations-solidworks-IMathTransform.jpg","width":1170,"height":830,"caption":"matrix transformations solidworks IMathTransform"},{"@type":"BreadcrumbList","@id":"https:\/\/cadbooster.com\/complete-overview-of-matrix-transformations-in-the-solidworks-api\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/cadbooster.com\/nl\/"},{"@type":"ListItem","position":2,"name":"A complete overview of matrix transformations in the SOLIDWORKS API"}]},{"@type":"WebSite","@id":"https:\/\/cadbooster.com\/#website","url":"https:\/\/cadbooster.com\/","name":"CAD Booster","description":"SOLIDWORKS AUTOMATION","publisher":{"@id":"https:\/\/cadbooster.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/cadbooster.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"nl-NL"},{"@type":"Organization","@id":"https:\/\/cadbooster.com\/#organization","name":"CAD Booster","url":"https:\/\/cadbooster.com\/","logo":{"@type":"ImageObject","inLanguage":"nl-NL","@id":"https:\/\/cadbooster.com\/#\/schema\/logo\/image\/","url":"https:\/\/cadbooster.com\/wp-content\/uploads\/2016\/11\/logo-CAD-Booster.png","contentUrl":"https:\/\/cadbooster.com\/wp-content\/uploads\/2016\/11\/logo-CAD-Booster.png","width":1732,"height":964,"caption":"CAD Booster"},"image":{"@id":"https:\/\/cadbooster.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/cadbooster.com\/#\/schema\/person\/3e38034e2c654d4589df4fceba30b2ed","name":"Peter Brinkhuis"}]}},"_links":{"self":[{"href":"https:\/\/cadbooster.com\/nl\/wp-json\/wp\/v2\/posts\/5193","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cadbooster.com\/nl\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cadbooster.com\/nl\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cadbooster.com\/nl\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/cadbooster.com\/nl\/wp-json\/wp\/v2\/comments?post=5193"}],"version-history":[{"count":2,"href":"https:\/\/cadbooster.com\/nl\/wp-json\/wp\/v2\/posts\/5193\/revisions"}],"predecessor-version":[{"id":14671,"href":"https:\/\/cadbooster.com\/nl\/wp-json\/wp\/v2\/posts\/5193\/revisions\/14671"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cadbooster.com\/nl\/wp-json\/wp\/v2\/media\/5246"}],"wp:attachment":[{"href":"https:\/\/cadbooster.com\/nl\/wp-json\/wp\/v2\/media?parent=5193"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cadbooster.com\/nl\/wp-json\/wp\/v2\/categories?post=5193"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cadbooster.com\/nl\/wp-json\/wp\/v2\/tags?post=5193"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}