Jump to content

Recommended Posts

Posted

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? 

Posted

I think we need a dwg to really see what you want a before after is needed. Can be VBA or Lisp. 

  • Like 1
  • 2 weeks later...
Posted

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.

Posted

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

Posted

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

Posted (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 by BIGAL
Posted

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.  

Posted

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.

 

  • Like 1
Posted

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.

Posted

Your "drawing" opens in the block editor and just shows attributes. 

 

You really need to post a before and after drawing file.

Posted

Agree SLW210 murry see last line in my post. We can not do anything its up to you to fix the sample dwg.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...