Jump to content

Rotate inserted table to UCS


ziele_o2k

Recommended Posts

I'm inserting new table using this routine:

(defun cd:ACX_AddTable (Space Pb Rows Cols RowH ColH)
 (vla-AddTable
    Space
    (vlax-3d-point (trans Pb 1 0))
    Rows
    Cols
    RowH
    ColH
 )
)

Example :

(cd:ACX_AddTable (cd:ACX_ASpace) (getpoint) 5 5 10 30)

but I'm don't know how to rotate inserted table to current UCS.

I'm guessing that this have something in common with direction property but I'm stuck here...

Any help ?

 

Subroutines:

(defun cd:ACX_ASpace ()
 (if (= (getvar "CVPORT") 1)
   (vla-item (cd:ACX_Blocks) "*Paper_Space")
   (cd:ACX_Model)
 )
)
(defun cd:ACX_Blocks ()
 (or
   *cd-Blocks*
   (setq *cd-Blocks* (vla-get-blocks (cd:ACX_ADoc)))
 )
 *cd-Blocks*
)
(defun cd:ACX_Model ()
 (or
   *cd-ModelSpace*
   (setq *cd-ModelSpace* (vla-get-ModelSpace (cd:ACX_ADoc)))
 )
 *cd-ModelSpace*
)
(defun cd:ACX_ADoc ()
 (or
   *cd-ActiveDocument*
   (setq *cd-ActiveDocument*
     (vla-get-ActiveDocument (vlax-get-acad-object))
   )
 )
 *cd-ActiveDocument*
)

Link to comment
Share on other sites

Try this

(setq table
 (vla-AddTable
    Space
    (vlax-3d-point (trans Pb 1 0))
    Rows
    Cols
    RowH
    ColH
 )
)

(vlax-put table 'direction (trans '(1 0 0) 1 0 T))

Link to comment
Share on other sites

I never had this problem. It seems it appears like this if you just insert the table.

vla-update doesn't help, but it comes to normal as soon as you start populating the cells or adjust the rows, columns.

Even a vla-move will regenerate it.

 

(setq table
 (vla-AddTable
    Space
    (vlax-3d-point 0.0 0.0 0.0)
    Rows
    Cols
    RowH
    ColH
 )
)

(vlax-put table 'direction (trans '(1 0 0) 1 0 T))
(vla-move table (vlax-3d-point 0.0 0.0 0.0) (vlax-3d-point (trans Pb 1 0)))

Edited by Stefan BMR
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...