[Closed] CAD Import coordsys woes
I wasn’t sure whether to put this here or in the main MAX forum, but it’ll end up being scripted, so I guess this is the best place.
I’ve got a large library of components that are xref’d in AutoCAD to build playground structures. To avoid the hassle of importing a bound/exploded drawing every time, I created a parallel library of max blocks, and parse a txt file output by AutoCAD which contains:
blockName, posX, posY, posZ, rotZ
All of this works great, and has for the last 4 years. However, I’ve recently been charged with doing a similar build routine for our parent company, and here’s where the problem is. Basically, when they build a structure, their components may end up being rotated along other axes, and somehow through their procedures, the block UCS is being modified. What happens then, is that when these structures are built in MAX using my scripts (even after modifying the LSP and MXS to account for rotX and rotY), the blocks are being rotated around a different coordsys, so they end up in locations all over the place.
I’m thinking I need to be writing a transformation matrix value to the LSP output, but I’m not familiar enough with AutoCAD to understand what’s going on, and how to go about giving MAX the information it needs to properly place these blocks.
This is probably a bit vague, but any insight into what might be happening would be greatly appreciated.
edit: Is the transform matrix always relative to WCS? If so then that would probably be the answer to my problem; output the matrix from aCAD, and do any kind of transforms in MAX relative to that matrix…?