Assign x,y coordinates based off of block instance insertion point
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I guess this question is in the correct place. I am using scripts from Excel to Notepad to AutoCAD to auto draw fabrication drawings.
I created an Excel program that allows the user to select a bunch of parts from a master list of all parts. Each part corresponds to an already built block in AutoCAD. Currently the program spits out a list of insert scripts to drop all of the necessary blocks right next to each other for the user to then assemble.
(-insert "BLOCKNAME" X,Y 1 1 0)
And for the x and y I just increment the x values by 10 each time so all of my blocks are in a row. Then I snap them all together by grabbing a parts insertion point and putting it on the appropriate point parameter on the frame. (I just made a bunch of point parameters on all possible snap points on the frame part that I can use.)
Is there a way using scripts to say "I want to insert this block on another blocks insertion point?" Or even better is to insert the block onto this specific block's "point snap A/B/C/etc"?
I am picturing something like this:
-insert "BLOCKNAME" DESTINATIONBLOCK.POINT_SNAP_A.Coordinates 1 1 0
or
-insert "BLOCKNAME" DESTINATIONBLOCK.Point_Snap_A.X , DESTINATIONBLOCK.Point_Snap_A.Y 1 1 0
At the end of the day I will not know the x and y coordinates that the block will need to go.
Also, if this cannot be done with scripts but is possible with LISP, y'all have any resources for LISP code writing? I am fluent in VB and use it all the time for Excel background programs.
Thank you.