A better explanation of what I want to do is below;
I have a button on a form and I need it to do the following -
Check if AutoCAD is running
If AutoCAD is running, maximise it and move the focus to it
If AutoCAD is not running, start it and move the focus to it
I'm thinking this should be...
Hi, I have a button in an access database. When I press the button I want to focus on another application, then send a command to it. Is this possible?
My exact requirements are to press the button at which point some vba will run. The vba will check to see if autocad is open. If not open, it...
Thanks for all your help Todd.
I gave on on layout filtering in the end and instead decided to create a new layer named the same as the layout on which the block resides to filter by. A bit messier than I wanted but it does the job.
Chris.
Does it help that I know that there will be only one block on each layout that we are trying to update? So there will be several layouts, 001, 002, 03, etv, but each layout will have one block called for example, 'TitleBlock'. Is there no way of identifying that? For example...
I posted on another forum and this was one of the replies;
Dim Id As Long
Dim b As AcadBlockReference
Id = ThisDrawing.PaperSpace.ObjectID
For Each b In ssTitleBlock
Debug.Print b.OwnerID
If b.OwnerID = Id Then
yadayada
Is that workable?
Thanks Todd, but it doesn't work. If set to 0 it won't select anything (nothing in model space), and if set to 1 it still selects the block on the first layout rather than the current layout.
After looking around I think whats needed is a routine of some sort to filter the selection set...
It seems that code 410 for layouts does not work in VBA. I have posted another thread http://www.tek-tips.com/viewthread.cfm?qid=1397234&page=1 to see if I can find a solution.
I have run across a problem that seems to have come up a few times, but all links to helpful resources in those threads are dead. I am trying to select a particular block on the active layout, however due to the failings of code 410 in VBA, I can only select the block on the first layout.
I'm...
The layout I want to update is current before I run the script, but it still imports the record into the block on the first layout, so if I understand correctly, it can't be a problem with an existing selection set still being in memory.
So I must have to modify the selection set filter codes...
Todd,
Thank you very much for all the help you are giving me.
I have now made the following changes;
On Error GoTo ExportAttribs_Error
strTblName = "tblDrawings" ' Table name in database.
strLayoutName = ThisDrawing.ActiveLayout.Name ' Current layout name...
Good Morning,
Thanks for the code snippet Todd. It came in handy and I can now delete a field in a record in the database, and have the appropriate attribute blanked in AutoCAD. The code I now have is as follows;
' Walk the array, comparing tag strings to field names,
' and populating or...
Hi again,
I had a bit of a breakthrough and I have managed to get the script to import fields to the attributes, however, I am receiving a type mismatch error when trying to import from empty fields. How can I get around this and leave an attribute blank if the corresponding field has no data...
Hi Todd, hope you are well today.
You are almost correct in what I want to achieve, of course my description becomes clearer the more I learn. All processes will be controlled from my access database, ie; a button press or other action. Command lines and scripts will then be passed to AutoCAD...
Ok, I have started analysing and trying to make what I can of the code. After following the FAQ I have the following;
Public AcadDoc As AcadDocument 'Current AutoCAD drawing document.
Public cnnDataBse As ADODB.Connection 'ADO connection to database.
Public rstAttribs As...
I had a look for information on the error message and couldnt see anything that immediately jumped out at me, so I'm just going to forget about that part of it. I think I'll be deleting that part of the code anyway, since all I want to do is read from the database, not write to it.
I'll keep...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.