Jump to content

Use excel table to flip or rotate a block 180 degrees?


Recommended Posts

Hi everyone,

 

I was someone might know a way to use data in an excel table to automatically flip or rotate an arrow block 180 degrees. I have alot of data that is in excel showing which direction to move objects to place them where they belong. This data will be updated and therefore the direction to move the object will possibly go back and forth. The only rotation would be 180 degrees so not too complicated.

 

Thank you for any help!

Link to comment
Share on other sites

You need to supply a lot more information.

 

Are you using OLE ?

A lisp to read cell values ?

A script made via excel ?

A script made via a csv output form excel ?

Link to comment
Share on other sites

I believe I am looking for a script made via a csv output from excel. I have found what others have been using the ATTOUT and ATTIN commands however it is not letting me select the blocks with this command. Is this because no attributes are associated with the blocks? I would just like to somehow possibly export the data from autocad, modify the data based on an if then function in excel and then import it back into cad and have the arrows display the correct direction.

Link to comment
Share on other sites

If your block has no attributes then slightly different way to change direction, taking for granted you know its insertion position x,y the you can search the dwg look for a certain block name, find the insertion point and rotate block accordingly.

 

(defun Roblock (/ x xy)
(setq ss1 (ssget "x" '((2 . "blockname"))))
(setq x 0)
(repeat (sslength)
(setq xy (assoc 10 (entget (ssname ss1 x))))
(princ xy)
; do your thing now compare to csv file
(setq x (+ x 1))
)
(Roblock)

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...