If the Blocks' defined zero-rotation directions are all in the direction you want aligned with the Polylines, and if their insertion points are all on or at least very close to the Polylines, and if you're working in the World Coordinate System, try this : That's much simpler than when Attributes are involved. And I want to rotate them align their own polylines. In fact, I have thousands of different blocks, on polyline. I want to rotate several blocks, with different angle. (defun c:AlignRotation (/ *error* doc osm asm ss i obj ang WCSAng rtd angd) Align objects to two points picked or input angle. I see now your "PKE" block is not as I thought it was. I think this revised version fixes the problem by temporarily setting the angdir (WHILE (NULL p) (SETQ p (CADR (ENTSEL "\nSelect Attribute :")))) Wrote in message found this bit of code, i shall try appending it to yours (when i have the time) (setq atts (vlax-invoke obj 'GetAttributes)) a list of attributes as vla-objects if any "INSERT"))) And you might want to filter out any xref blocks. Of course you might also change it to only select blocks. This is just a rough idea regarding how you might modify what I posted to move theĪttributes. Shortcut is the same as the one for the array command (princ (strcat "\nAngle: " (rtos (rtd ang) 2 4))) (if (eq "AcDbMText" (vla-get-ObjectName obj)) (setq obj (vlax-ename->vla-object (ssname ss i))) (setq ang (getangle "\nEnter angle or pick two points for alignment: ")) (strcat "\nEnter angle or pick two points for alignment: " (setq doc (vla-get-ActiveDocument (vlax-get-acad-object))) Convert angle from UCS to WCS - by John Uhden. Mtext angle (code 50) is in terms of UCS. ((wcmatch (strcase msg) "*QUIT*,*CANCEL*")) (defun c:AlignRotation (/ *error* doc osm asm ss i obj ang WCSAng rtd) Works with text, mtext and block references (inserts). Align selected objects to two points picked or input angle. Intervention should be limited to the picking of the polyline, the blocks toĪnd finally the side of the line to move the block attributes to. I really would appreciate it if somebody could help me with this lisp.Īttached is a dwg example of the kind of thing i'm looking for. Wrote in message have spent quite a long time searching for a lisp to rotate blocks by I'll post the code if you are interested. Object will align given the order of points picked. Any two points will do and you can determine The angle of a block, mtext or text object. "Joe Burke" wrote in I use to do something similar requires the user to pick two points
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |