Results 1 to 7 of 7

Thread: attribute fill in from a FORM

  1. #1
    Join Date
    Oct 2007
    Posts
    9

    attribute fill in from a FORM

    i have a blockname = stempel_A3

    attributes what are in this "block" (stempel_A3)
    "BK01"
    "uitgd0"
    "uitg0"
    "gec0"
    "get0"
    "opm0"

    what i try to make is to update mine titleblock with a custum form.
    same like attribute edit but then from out a form.

    i have zipped the file included all (dwg. form. database.)
    maybe someone can helped me

    thank you
    Attached Files Attached Files

  2. #2
    Join Date
    Mar 2004
    Location
    Brisbane, Australia
    Posts
    856
    Just so I understand you correctly.
    You want to have a form that you fill in then click OK and have those parameters added/modified in the titleblock is this correct ?

  3. #3
    Join Date
    Oct 2007
    Posts
    9
    yes this is correct

    i would like to fill it in or to change and when i click on OK
    it must change the block in the drawing

    thank you

  4. #4
    Join Date
    Mar 2004
    Location
    Brisbane, Australia
    Posts
    856
    Can you post the code you are using for this ?

  5. #5
    Join Date
    Oct 2007
    Posts
    9
    i have post it in the zip file in this in begin

  6. #6
    Join Date
    Oct 2007
    Posts
    9
    oh mine excuse i saw it was protected
    Attached Files Attached Files

  7. #7
    Join Date
    Mar 2004
    Location
    Brisbane, Australia
    Posts
    856
    Your Table has a lot of information missing, that will cause the code to fail when it tries to get the info from those database fields.

    Code:
    Private Sub UserForm_Initialize()
      Dim EntGrp(0) As Integer
      Dim EntPrp(0) As Variant
      Dim BlkObj As Object
      Dim Pt1(0) As Double
      Dim Pt2(0) As Double
     
      'define error function
      On Error GoTo Err_Control
     
        'create a selection set
        ThisDrawing.SelectionSets.Item("TBLK").Delete
        Set ssnew = ThisDrawing.SelectionSets.Add("TBLK")
     
        'Filter for Group code 2, the block name
        EntGrp(0) = 0
     
        'The name of the block to filter for
        EntPrp(0) = "Stempel_A3"
        'EntPrp(0) = "Onderhoek"
     
        'find the block
        ssnew.Select acSelectionSetAll
     
        'If a block is found
        'If ssnew.Count >= 1 Then
     
        'Get the block's attributes
            Tatts = ssnew.Item(0).GetAttributes
     
            Titelblok.txtBK01 = (LTrim(Tatts(0).TextString))
     
            Titelblok.txtuitg0 = (LTrim(Tatts(1).TextString))
            Titelblok.txtuitgd0 = (LTrim(Tatts(2).TextString))
            Titelblok.txtget0 = (LTrim(Tatts(3).TextString))
            Titelblok.txtgec0 = (LTrim(Tatts(4).TextString))
            Titelblok.txtopm0 = (LTrim(Tatts(5).TextString))
     
            'set the focus to TextBox1 and highlight the text
            Titelblok.txtBK01.SetFocus
            Titelblok.txtBK01.SelStart = 0
            Titelblok.txtBK01.SelLength = Len(Titelblok.txtBK01.Text)
     
        'Else
            'no attribute block, inform the user
    '        MsgBox "No Title Block Attributes - Use Manual Edit..", vbCritical, "Title Block"
     
    ResumeHere:
        Exit Sub
     
    Err_Control:
     
            'disply error number and description
            MsgBox err.Number & " " & err.Description
     
            GoTo ResumeHere
     
    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •