Jump to content

Recommended Posts

Posted

Can VBA be used to Rename a Layout Tab with version 2010 of AutoCAD?

Thank you,

Posted
Can VBA be used to Rename a Layout Tab with version 2010 of AutoCAD?

Thank you,

 

Yes.

 

ThisDrawing.Layouts.Item(0).Name = "Renamed"

Posted

You know it took me a while to also utilize something within AutoCAD which often times let me access AutoCAD control which was impossible, or just more complicated through the Object model.

 

Although it is part of the object model, it bypasses the standard way of manipulating acad objects in VBA/VB. I wanted to code, and considered it a cheat, until in many circumstances it was easier, as or more reliable, and fast enough. I soon saw the light, and also liked the fact that sometimes, due to command line options, it also allowed more optional control when doing an acad operation.

 

The AutoCAD "sendcommand" method is nice. For instance, if you are inserting a block, with standard vb and vba, and you have set the block and in the steps of rotating, or scaling, you don't see the ghosted block like you do at the command line, but with sendcommand, you see the insertion as if you where inserting from the command line.

 

It's true that sendkeys can be used from the BASIC language, but it sometimes hangs, or does unpredicatable things, sendcommand is very reliable in my experience, and also uses the familiar command line syntax and options of acad.

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...