.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Remove VBA from drawing

12 REPLIES 12
Reply
Message 1 of 13
dvertz
2133 Views, 12 Replies

Remove VBA from drawing

Been a long time since I have come to the forums. They have changed. I hope I am in the correct place for this question.

 

We have just upgraded Autocad from 2008 to 2014. Most of our drawing have an embeded VBA content in them. When we open the drawings we get a notice to "Convert, Download or Continue". We know what this OLD content is and wish to remove it completely. We would rather not download the VBA modules, for this will remove the warning all together.

 

Is there a way to remove the VBA content?

 

Thanks.

Civil 3D 2022,
Windows 10 Pro, x64, Nvidia Quadro P1000
Intel Core i9-11900k; 3.50GHz, 32 GB RAM, 500GB WD BLACK M.2


12 REPLIES 12
Message 2 of 13
fieldguy
in reply to: dvertz
Message 3 of 13
dvertz
in reply to: fieldguy

fieldguy,

 

Thanks for your reply.

Sorry for taking so long to follow up. You probably know how those rush projects are.

 

I followed your link and downloaded the lisp file. I couldn't see how the VBA script would help when I would need the modules to run it, which is exactly what I don't want.

 

I ran the lisp and it failed. Through debugging I found that (vla-item dicts "ACAD_VBA") was returning nil.

I then searched and found how to return what dictionaries actually exist. The list returned:

 

ACAD_BACKGROUND
ACAD_CIP_PREVIOUS_PRODUCT_INFO
ACAD_COLOR ACAD_DETAILVIEWSTYLE
#<%catch-all-apply-error%>
#<%catch-all-apply-error%>
ACAD_IMAGE_DICT
#<%catch-all-apply-error%>
#<%catch-all-apply-error%>
#<%catch-all-apply-error%>
ACAD_MLEADERSTYLE
ACAD_MLINESTYLE
ACAD_PDFDEFINITIONS
#<%catch-all-apply-error%>
ACAD_PLOTSTYLENAME
ACAD_SCALELIST
ACAD_SECTIONVIEWSTYLE
ACAD_TABLESTYLE
ACAD_VISUALSTYLE
#<%catch-all-apply-error%>
AcAec AcDbVariableDictionary
ADE_QUERY_LIBRARY
AEC_CLASSIFICATION_SYSTEM_DEFS
AEC_DISP_REP_CONFIGURATIONS
AEC_DISP_REP_SETS AEC_DISP_REPS
AEC_DISPLAY_PROPS_DEFAULTS
AEC_LAYERKEY_STYLES
AEC_PROPERTY_SET_DEFS AEC_VARS
ASE_INDEX_DICTIONARY
Autodesk_MAP BNS_VARIABLES
ESRI_PRJ
#<%catch-all-apply-error%>
#<%catch-all-apply-error%>
SCAD_XML
{24DE2741-47F6-4298-B91B-737E814BAE3E}

 

So this is the reason (vla-item dicts "ACAD_VBA") would return nil. It doesn't exist. So someplace else Autocad 2013 thinks there are VBA content in the drawing and wants to download the VBA modules. We don't want modules or VBA anymore.

 

So I am still searching for a way to remove the VBA content from the drawings.

Civil 3D 2022,
Windows 10 Pro, x64, Nvidia Quadro P1000
Intel Core i9-11900k; 3.50GHz, 32 GB RAM, 500GB WD BLACK M.2


Message 4 of 13
Jeff_M
in reply to: dvertz


@dvertz wrote:

....we get a notice to "Convert, Download or Continue". We know what this OLD content is .


What is it? In Civil3D we get that message when we have older drawings with Pipe & Structure rules that were written in VBA (which everything was up to C3D2010). These should convert if we choose the COnvert option, since the new rules are .NET based.

Jeff_M, also a frequent Swamper
EESignature
Message 5 of 13
dvertz
in reply to: Jeff_M

Jeff_M,

 

We are coming forward from C3D 2008. Some of our drawinsg will have C3D VBA content. The people here in charge have decided that "all old projects are to remain in 2008" and "all new projects are to be started in 2013". This will help a lot to keep the C3D content from needing to be converted.

 

However, some of the drawings which are NOT C3D have this little program called "layout switch (loswitch.dvb)" which basically would reassign layer states based on the layout tab. We have removed that from autoloading because we no longer use it. But the drawings still have it embeded.

 

Now that we no longer use it, and its embeded in the old drawings, when we need to bring one of those drawings out of retirement to update it to new design in 2013, of course we get this message.

Civil 3D 2022,
Windows 10 Pro, x64, Nvidia Quadro P1000
Intel Core i9-11900k; 3.50GHz, 32 GB RAM, 500GB WD BLACK M.2


Message 6 of 13
Jeff_M
in reply to: dvertz

Could I get a stripped down copy of one of these files? If a dvb is embedded, it should have the ACAD_VBA dictionary so I'm not quite sure what's going on without seeing it. If you'd rather not post it here, feel free to email me: jeffmATquuxsoftDOTcom

Jeff_M, also a frequent Swamper
EESignature
Message 7 of 13
dvertz
in reply to: Jeff_M

Jeff_M,

 

Thanks for looking at this.

I am new to attaching files so I hope I get this right.

The file has been "stripped" as much as I could. No entities, purged, 1 layout (required). Still prompts to download VBA Modules

Civil 3D 2022,
Windows 10 Pro, x64, Nvidia Quadro P1000
Intel Core i9-11900k; 3.50GHz, 32 GB RAM, 500GB WD BLACK M.2


Message 8 of 13
Jeff_M
in reply to: dvertz

dverts, this drawing does not contain any embedded dvb's. What it does contain are older C3D objects that it wants to convert to .NET.

1-16-2014 4-39-36 PM.png

Allow it to do so by selecting Convert. When I do so in this dwg I get this:

 

Opening an AutoCAD 2013 format file.
Regenerating model.
220 Pipe and Structure Rule(s) are converted to .NET.
AutoCAD menu utilities loaded.

 

Which is a bit odd since there are only 1 of each in the drawing. But once saved I can reopen it with no more messages regarding VBA.

Jeff_M, also a frequent Swamper
EESignature
Message 9 of 13
dvertz
in reply to: Jeff_M

Jeff_M,

 

Thank you for diving in deep for me. I have to say, that dialog you posted is exactly what I want to see go away. I think it is slightly decieving. Shouldn't it say it is older C3D objects instead of VBA? I guess the older C3D objects are created using VBA.

 

Obviously, that drawing hs no objects so C3D objects could go away. Is there a way to remove those without converting to .NET? Some of our drawing are just boundary work that has these older C3D objects that need to just go away. Why can't we just "purge" those unused objects?

Civil 3D 2022,
Windows 10 Pro, x64, Nvidia Quadro P1000
Intel Core i9-11900k; 3.50GHz, 32 GB RAM, 500GB WD BLACK M.2


Message 10 of 13
Jeff_M
in reply to: dvertz

Other than using the ExportToAutoCAD, no, I'm not aware of a way to remove C3D content from a drawing. I had thought something like this was posted in one of the Dev. Blogs but I sure cannot find it now. I did some testing of things I thought might work, with no success. I think that you should resign yourself to instructing your users to be sure to hit that Convert button.... If I find another solution I will post it here.

Jeff_M, also a frequent Swamper
EESignature
Message 11 of 13
SENL1362
in reply to: Jeff_M

i am facing the same problem with AEC objects.

When opened as a document, i can query and purge MS and DICT's for these AEC objects. However when loaded using READDWGFILE and not showing the DB in a document, these AEC objects cannot be found.
Not even when evaluating each ObjectID instead of looping through the table records.
Message 12 of 13
dvertz
in reply to: SENL1362

I guess my lack of knowledge of C3D comes from not working in C3D. I work on the Surveying side in a Civil Engineering company. The Surveying team doesn't use C3D, we use Carlson Survey. So the Surveying team doesn't need (or want) the C3D objects (that could potentially get corrupted) in the drawing. Basically the more stuff in there (stuff you don't even need), the more chances of corruption. Besides, it just increases drawing size when it doesn't need to. We are already working with drawings reaching 10+ MB. Working with large surfaces can and has crashed the system.

 

Further discovery has shown that it is NOT objects in the drawing but rather "Rules". But yet again, not having a need for these "Rules", we would just rather not even have them there to start with.

 

It looks like Jeff_M may be on track with exporting the objects into a template that is not C3D. The only thing is, I think these "Rules" come in with a copy and paste in the first place.

 

Oh well, I don't see a box to check and say always apply this choice. So I guess I will have to put up with this for every drawing I open.

 

Thanks for everyones help.

Civil 3D 2022,
Windows 10 Pro, x64, Nvidia Quadro P1000
Intel Core i9-11900k; 3.50GHz, 32 GB RAM, 500GB WD BLACK M.2


Message 13 of 13
Jeff_M
in reply to: dvertz

I have found a way to strip out the Civil3D dictionary without needing to manually open the drawings. Note that this will really mess up drawings that are actually being used in Civil3D (all settings & styles will be gone), but it will do what you wanted to have a 'clean' drawing. Be sure to test on a few drawings first!! When you download the ZIP file, be sure to right click on the saved file, choose properties, General tab, hit the Unblock button near the bottom, if it exists, prior to unzipping the dll. Save to a place you can remember, inside of AutoCAD NETLOAD the stripcivil3d.dll. The command name is STRIPC3D. Be sure to NOT select any open drawings. There is minimal error checking, but it will create a BAK file when saving the dwg's. Drawings that do not have C3D content are not saved.

Jeff_M, also a frequent Swamper
EESignature

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost