Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: PZero
  • Order by date
  1. PZero

    Return focus to app, then send a command?

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

    Return focus to app, then send a command?

    Unfortunately I need to with the VBA in Acess, which deosn't support AutoCAD VBA.
  3. PZero

    Return focus to app, then send a command?

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

    AtoCAD, Access and VBA

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

    AtoCAD, Access and VBA

    What about removing blocks from the selectionset that aren't on the current layout? Is that a possibility?
  6. PZero

    AtoCAD, Access and VBA

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

    AtoCAD, Access and VBA

    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?
  8. PZero

    AtoCAD, Access and VBA

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

    DXF code 410 VBA solutions?

    Sorry, my code actually looks like the following; ' Build the filter criteria. ' BuildFilter intData, varData, -4, "<and", _ 0, "INSERT", _ 2, "TitleBlock", _ -4, "and>" _ ' Ensure a...
  10. PZero

    AtoCAD, Access and VBA

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

    DXF code 410 VBA solutions?

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

    AtoCAD, Access and VBA

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

    AtoCAD, Access and VBA

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

    AtoCAD, Access and VBA

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

    AtoCAD, Access and VBA

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

    AtoCAD, Access and VBA

    By the way, to make things a bit easier and because of the nature of the data I need to handle, the primary key will be Autonumber.
  17. PZero

    AtoCAD, Access and VBA

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

    AtoCAD, Access and VBA

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

    AtoCAD, Access and VBA

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

    System restarts when system tray is clicked

    I think I'll try a reinstall of XP because the automatic restart option is already off. There is no BSOD to read an error number from! Thanks guys.

Part and Inventory Search

Back
Top