Hello my fellow SOLIDWORKS API programmers,
Last week I was struggling a lot with matrix transformations, as you could have read in this topic. I found the API help to be unclear and incomplete. On top of that, API support couldn't really explain the concepts to me and they gave me one answer which I still think is wrong.
So I wrote a big blog post to share everything that I know about matrix transformations. I start with the very basics, what is a matrix and what is a transformation. I then show how they are used within SOLIDWORKS as IMathTransform and I end it all with a list of useful macros and forum topics.
Here it is:
https://cadbooster.com/complete-overview-of-matrix-transformations-in-the-solidworks-api/
I would love your input to make this post even better. Besides fixing errors, the main things I still want to improve:
- Add API commands with the space of their returns values!!
- More API examples
- More links to useful articles and macros
What information or which link would you like to include in this article? What info were you missing while you were messing with transformations? Every improvement is appreciated.
Hi Peter
Brilliant! - Nice work thankyou
I shared a similar experience delving into transforms earlier this year. I spent a couple of days with my head completely battered.. so your blog would have been nice to have then.. and as my old brain doesn't retain information so well these days I'm sure I'll check it out again.
I have an example I can share that uses
CreateTransformRotateAxis Method (IMathUtility)
ComposeTransform Method (IMathUtility)
Cross Method (IMathVector)
Dot Method (IMathVector)
[edit]
It also includes a function for ACos which is missing in VBA.
Just found it! missing in VBA but provided by SW
[edit]
The macro doesn't do much.
It takes a face - looks for an entity named "MeMeMe" - and obtains the underlying surface.
It then creates a transform to rotate to the front plane.
It then just grabs the vertices and adds a 3d sketch of the vertices before and after transformation.
In the part attached I manually added a sketch point and axis that show the root point of the surface.
Maybe it's helpful to someone, unfortunately I didn't comment it very well.
Thanks again
Have a sweet weekend!