wgtkna Posted November 4, 2016 Share Posted November 4, 2016 Curley question for all you AutoCAD macro masters out there. I have an issue where I need a macro that automates the repetitive process of making an AutoCAD block. Im often tasked to create cut files for manufacturing processes. These cut files are generally closed polylines that contain a part number in the form of single line text & various other geometries contained within the boundary of the closed polyline. My normal workflow to create a single part is 1. Double click on the part number which is AutoCAD single line text to bring up the text editor 2. Highlight & copy the part number onto the clipboard (ctrl+c) 3. Escape out of the text editor 4. Bring up the AutoCAD block pallet (“block” or “b” command) 5. Paste the copied part number into the block name field 6. Select a base point 7. Select the objects 8. Press Enter and im done with one part I use this workflow for Three reasons, 1. It groups all the geometries nicely together 2. It throws up a duplicate part number red flag in the form of the AutoCAD redefine block prompt if I accidently have duplicate part numbers 3. It allows me to copy all parts elsewhere in model space and nest all the parts / blocks into sheets while still maintaining some order of the original parts. I end up with 2 instances of each part /block. 1 which is where I originally created it and a second instance which is nested in a sheet elsewhere in model space. If I need to go back to modify A part I can do that in the original instance area which is uncluttered and has the surrounding parts adjacent for reference. I find trying to modify parts after they have been nested difficult as they are often orientated at odd angles as a result of the nesting process. I have made a short screencast of my workflow to illustrate should the above not make sense. You can view it on here https://youtu.be/b__oUKJ9zDQ While some people may not think my process to tedious I tend to go a little crazy when some of my assemblies are getting up to 1000 parts. It would be great if I had a Macro that automated steps 1 through 10 above that pauses for user input at steps 1, 6 & 7. Any help greatly appreciated. Quote Link to comment Share on other sites More sharing options...
maratovich Posted November 5, 2016 Share Posted November 5, 2016 base point is always the same? Always at the bottom left? The text is always only one thing? Quote Link to comment Share on other sites More sharing options...
wgtkna Posted November 5, 2016 Author Share Posted November 5, 2016 Hi maratovich The base point varies fro block to block so I would need to specify that for each block. you second question "The text is always only one thing?" I dont fully understand so forgive if the following dosnt answer your question. The text varies for each part as each part needs its own unique part number. There is often other text geometries contained in the block, these are usually instructions for the manufacturing team. I could if you like make the part number on its own unique layer. perhaps call the layer "Part Number" so when i select all the geometries to make up a block the only item on layer Part Number is the block name? Quote Link to comment Share on other sites More sharing options...
maratovich Posted November 5, 2016 Share Posted November 5, 2016 Hi maratovichThere is often other text geometries contained in the block, these are usually instructions for the manufacturing team. I could if you like make the part number on its own unique layer. Yes, that's what I was asking. I could if you like make the part number on its own unique layer. perhaps call the layer "Part Number" so when i select all the geometries to make up a block the only item on layer Part Number is the block name? I'll try to do. BlockCreator.zip Quote Link to comment Share on other sites More sharing options...
maratovich Posted November 5, 2016 Share Posted November 5, 2016 image .gif not load (( Image GIF help.zip Quote Link to comment Share on other sites More sharing options...
maratovich Posted November 5, 2016 Share Posted November 5, 2016 Done. Program in archive. BlockCreator v2.zip Quote Link to comment Share on other sites More sharing options...
wgtkna Posted November 6, 2016 Author Share Posted November 6, 2016 Hi maratovich Impressed!!!!!!!!!! Your BlockCreator v2 works flawlessly! You have even built in the ability to change the layer name the part numbers reside on. great foresight on your behalf. I cant thank you enough. Is this sort of service something you provide professionally? if so im happy to employ your services on a professional financial basis in the future. Let me know your contact details. you can find my contact details at http://www.cadprojects.com.au Regards Quote Link to comment Share on other sites More sharing options...
maratovich Posted November 6, 2016 Share Posted November 6, 2016 Good. Yes, we can cooperate. Contact sent a private message. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.