murry Posted March 13 Posted March 13 Hey there, So I am currently working under the standard AutoCAD. I am dealing with PIDs that are extremely outdated and not well maintained. As I have been redrawing them, I am running into major issues with duplicate line numbers, wrong specs, etc. I have been trying to figure a way to create a block with attributes that allows you to fill in each entity of the line designation with a ' - ' in between each of them. I want to steer clear of the insertion field of the hyphen, simply because it can easily be removed. The ultimate goal of this will be so I can run VBA and extract these to verify and make changes accordingly. Can anyone on here guide me to a solution for this? Quote
BIGAL Posted March 14 Posted March 14 I think we need a dwg to really see what you want a before after is needed. Can be VBA or Lisp. 1 Quote
tombu Posted March 27 Posted March 27 Be forewarned I would never enable VBA in AutoCAD. It was removed from all AutoCAD products years ago as it left AutoCAD as well as everything accessible by your PC vulnerable. As installed today AutoCAD is as safe from hacking as any software out there but all that goes out the window if you enable VBA. If that's really what you want to do your post should be in .NET, ObjectARX & VBA forum where you'd be more likely to ge a response to a VBA question. Quote
murry Posted March 27 Author Posted March 27 I have attached below what I currently plan on implementing. The drawings currently have regular text for line information. My overall goal is to create a way to keep track of the line info moving forward and help me figure out and sort the errors as I go through them. Honestly, I am open to any suggestions you guys might have as a solution. I am a one-man show over here for the company I am working for and there is a lot of discrepancies th roughout these drawings. If it will help give a better understanding I can post some of the drawings as well. PID-Line-ID.dwg Quote
murry Posted March 27 Author Posted March 27 Just to throw it out there, if you guys have a LISP routine for executing something like this, that would be awesome! I was unaware about dangers with running VBA Quote
BIGAL Posted March 28 Posted March 28 (edited) Autodesk threatened to remove VBA some 5 years ago it is still there not sure about VBA may make your pc venerable does Microsoft not own Word and Excel ? Both have VBA as their macro language. Same with any code if it has something hidden do you know ? I am sure my Norton does not check my lsp or fas files for something like a delete file. If you have a dvb file you may be able to open it and check, if using .net good luck checking that. Answer to the question is using lisp with wcmatch can look for a "-" in a string if true do something. Next question post a before and after dwg no idea what has to be changed to what. Various ways to display current value and input new value. Ps pasted attributes into cpm using bedit so was now a block that made sense to me. Please repost a dwg with a block containing attributes. Edited March 28 by BIGAL Quote
Danielm103 Posted March 28 Posted March 28 I think this comment about VBA is wrong. It may be true that VBA 6 had issues, I think the current version, 7.1, is safer. Millions of office users are still using it. AutoCAD registers itself as a COM server regardless if VBA is installed or not. The biggest reason not to use it is because it’s a lame language : | but hey, if you need it “Autodesk threatened to remove VBA” This is because of the new license fees MS wanted to charge. Quote
tombu Posted March 28 Posted March 28 Microsoft like AutoCAD allows VBA to be enabled because so many old VBA users still can't let go but both recommend against it. In Excel this option is Enable VBA macros (not recommended, potentially dangerous code can run) and it only applies to VBA macros. True there are many that ignore these warning and enable VBA code anyway. As long as you work in a closed shop, stay offline and don't exchange files outside your office you're probably fine. 1 Quote
Danielm103 Posted March 28 Posted March 28 I’m guess your thinking of embedded macros, my comment was directed at DVB modules you would run like any other API module https://www.autodesk.com/support/technical/article/caas/sfdcarticles/sfdcarticles/Embed-Visual-Basic-for-Applications-VBA-project-or-save-to-DVB-file.html Quote
SLW210 Posted March 28 Posted March 28 VBA is just as safe as anything else, even macros. You always need to verify the source is safe and trustworthy on everything. Certainly code you make yourself should be trustworthy. Quote
SLW210 Posted March 28 Posted March 28 Your "drawing" opens in the block editor and just shows attributes. You really need to post a before and after drawing file. Quote
BIGAL Posted March 28 Posted March 28 Agree SLW210 murry see last line in my post. We can not do anything its up to you to fix the sample dwg. Quote
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.