Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

Block Reference is Tilted in Z Axis

jthompsonGJ3BH
Explorer

Block Reference is Tilted in Z Axis

jthompsonGJ3BH
Explorer
Explorer

A client provided a site layout drawing that includes several hundred blocks of PV module single axis tracker "tables". 

 

Each of these blocks are titled or rotated in the Z-Axis. If looking from the left point of view on the view cube, they are not parallel to the axes and tilt up or down. See image attached. 

 

My firm works in a complete 2D plain. I typically solve issues where clients provide 3D files by changing the Z-position of these blocks to 0. In this case, only the base point of the block goes to 0, while the remainder is still at a different elevation. 

 

I am looking for a way forward to fix all of these blocks in just a few commands. For example, is there some kind of hidden property for a rotation on this axis that I can reset to 0? I need to keep the X and the Y coordinates the same. 

 

I've attached an example where I modified the block in block editor to be a simple rectangle (I had to remove proprietary information from the client and their vendor). The issue must be with the block in the model space, not the block itself. No matter what edits I do, it still has this tilt. 

 

Looking forward to advice. 

 

On a site note, I did try the below methods, but they do not work or are not preferable. 

  1. Running the commands as follows - this sends the blocks all over the drawing file at such a large scale that you can not zoom into them.
    1. (command "MOVE" (ssget "x") "" "0,0,0" "0,0,1e99")
      (command "MOVE" (ssget "p") "" "0,0,0" "0,0,-1e99")
  2. Running the FLATTEN command - this command takes a significant amount of time, it redefines each table as its own block which prevents further editing for our firm's layer standards or the ability to BCOUNT, and it does not seem to even work that well on the flatten.
0 Likes
Reply
535 Views
5 Replies
Replies (5)

pendean
Community Legend
Community Legend

@jthompsonGJ3BH Your sample is a BLOCK of a pline square, correct? Rotate the UCS to see it

pendean_0-1704909987748.png

 

 

Can you EXPLODE it then use FLATTEN command or do you need to maintain the blockname?

 

Why not ask the file creator for a 2D file if there is way more to it the content, do you know which variant of AutoCAD then used and what tile of drawing this is? Or do you wish to own possible edits and discrepancies created by your file editing for this project you have with them.

0 Likes

jthompsonGJ3BH
Explorer
Explorer

Thank you @pendean for the response. 

 

-The block itself isn't a PLINE square, that is just the general shape. I had to delete internal proprietary components. 

-I'd rather not explode it. There are several hundred within the file and I want to have the ability to modify them, as well as use BCOUNT features.

-We've asked the original creator to provide a 2D version, but they either do not understand our request or will not modify their procedure to accommodate us. I was hoping to figure out a work around for when they eventually send us files with a similar issue. 

0 Likes

pendean
Community Legend
Community Legend

@jthompsonGJ3BH wrote:

-We've asked the original creator to provide a 2D version, but they either do not understand our request or will not modify their procedure to accommodate us. I was hoping to figure out a work around for when they eventually send us files with a similar issue. 


I suspect because what you want ultimately (keep everything as is but make it 2d) is literally not feasible.

 

You're going to have to alter the DWG content to get true 2D only, there are many ways and all involve altering the content in one form or another, or consider limiting yourselves by using a restrictive-to-you tool like OSNAPZ  https://help.autodesk.com/view/ACD/2023/ENU/?guid=GUID-5A49F08E-C0FD-4B38-9253-BC60197E1A60 

 

Find a way to share a portion of the actual content of the file for additional tips, explain in that portion what you wish to see "in 2D" since your WCS was rotated and all:  a rectangle in a block substitute is really not enough for remote help.

0 Likes

jthompsonGJ3BH
Explorer
Explorer

For now, I am moving forward with using keeping the block as is and keeping OSNAPZ to 1 such that I don't snap to any odd Z dimension. While it didn't solve the issue, it at least avoids it. 

 

I only rotated the cube in the drawing I attached here to show the issue. It doesn't matter what is in the block definition, the block will always be skewed. 

 

Thanks for trying to help! Appreciate it. 

0 Likes

leeminardi
Mentor
Mentor

Try the following lisp program.  It assumes that you select a block and that its base point is on the XY world plane (z = 0).  It also assumes that after reorienting the block the block's x axis is parallel to the world x axis.

(defun c:test (/ osm blkdata Tmatrix BasePt ptBlockX ptBlockXY ptxaxis
	       ptxyplane)
; aligns block to the xy plane
; lrm 1/10/2024  
  (setq osm (getvar "osmode"))
  (setvar "osmode" 0)
  (setq	blkdata	  (nentsel)
	Tmatrix	  (nth 2 blkdata)
	BasePt	  (nth 3 Tmatrix)
	ptBlockX  (mapcar '+ BasePt (nth 0 Tmatrix))
	ptBlockXY (mapcar '+ BasePt (nth 0 Tmatrix) (nth 1 Tmatrix))
	ptxaxis	  (mapcar '+ BasePt '(100 0 0))
	ptxyplane (mapcar '+ Basept '(100 100 0))
  )
  (command "_align"   "last"	 ""	    BasePt     BasePt
	   ptBlockX   ptxaxis	 ptBlockXY  ptxyplane  
	  )
  (setvar "osmode" osm)
  (princ)
)

 

 

 

 

 

 

lee.minardi
0 Likes