Using VBA to generate fabrication tags and assemblies from polyline properties

Using VBA to generate fabrication tags and assemblies from polyline properties

bull504
Enthusiast Enthusiast
1,180 Views
3 Replies
Message 1 of 4

Using VBA to generate fabrication tags and assemblies from polyline properties

bull504
Enthusiast
Enthusiast

Hello all,

To start, I am very new to coding but have using Autocad for 5+ years. At my work we generate cutlists and fabrication tickets from a rudimentary dynamic block with multiple attributes with part numbers, finished, lengths, qty's all manual entered and perform a data extraction to a .csv of these tag blocks to generate the cut list. This is obviously prone to input errors and involves hours checking properties in the cut list to the drawings. I feel like there is a way to automate this process. 

My question to the forums is, is it feasible to write a symbol script or macro that can apply multiple tags to a polyline using part numbers and part descriptions that are set up from the beginning, apply its length from the drawings, apply a reduction to necessary parts, and automatically increment the tags from parts that have different attributes?

 

If it can be done, am I looking down the right path to handle what I have described? is there a better easier way? What difficulty level of coding is this considered? As in is it possible for me to teach myself VBA and write something like this in a month or 2? or is there already something out there that does this? I have searched and can't find anything. What should I look into to get started?

 

Any and all input is appreciated

0 Likes
1,181 Views
3 Replies
Replies (3)
Message 2 of 4

norman.yuan
Mentor
Mentor

It is not easy to suggest/recommend something before knowing more details about your situation, such as:

  • Do you use plain AutoCAD, or an AutoCAD vertical (Advanced Steel, MEP, Architecture...)
  • What is your programming knowledge/skill/aptitude (if you intend to start learning)

Yes, the process should and can be automated and can be done in different levels, depending on who/how it is done. If you choose DIY, but with very limited programming resources (knowledge/skill of yourself, or whoever you can turn to), you may want to a little at a time, and gradually grow it. You can utilize AutoCAd script, LISP, VBA, and surely combination of all of them. I can see it would take at least a few months (if you do know some programming, LISP, or VBA), but it can easily be years. Just by roughly your description, I would not be surprised that it would take a good AutoCAD programmer a couple of months.

 

Also, while VBA is easier to get you started (or you have already know some of it), I can see the final solution from your description would end up quite complicated and large (most AutoCAD development project starts small and snow-balls to "monstor" that needs good programmer to maintain it). If the solution involves UI (user interface) very much, using VBA could problematic (because of VBA's lack of 64-bit UI support), and you may want the solution to be built on AutoCAD's .NET API.

 

I'd suggest you find someone who really knows AutoCAD programming to consult to, so you know the possible scale of the work; then decide you want to DIY, or hire professional to do it for you. The latter usually turns out to be the winner/money saver in most cases, unless you are sure/confident your existing/future programming skill (but IMO, "a month or 2" is absolutely not possible, from the question you asked. Sorry).

 

There could be programs that may have already done what you want, or similar/close (so long as you can change your work process a bit). You can search Autodesk's app store. Either you find something you can use/adopt; or you can find something close, but need to change: you could reach out the its developer for your needs.

 

If you do know what exactly needs to do and have started your own code more or less, but need some guide/sugeestion on how to go further, you can post here with your you have done with your question. Do remember, this forum is for AutoCAD VBA, though.

Norman Yuan

Drive CAD With Code

EESignature

0 Likes
Message 3 of 4

bull504
Enthusiast
Enthusiast

Thanks for the reply,

I use plain Autocad 2020. I have no programming experience though I plan to start learning. The basis of this post was in the hopes of getting a feel of how in depth of a project like this could be. 1 or 2 months time frame was a complete guess. Work is slow for the time being so it is an ideal time for improving on our processes and how we do things. 

We don't have anyone around for consulting in our company so forums is the only place I could ask for opinions. Your reply has been helpful to shed some light on what is involved. Maybe someone out there knows of a plug in that can do what I'm looking for?

0 Likes
Message 4 of 4

parikhnidi
Advocate
Advocate

Can you show me a typical drawing and the desired result. As Norman mentioned, I think, the solution is possible.

 

Nimish

0 Likes