Table modify

Discussion in 'AutoCAD' started by TCEBob, Jan 19, 2005.

  1. TCEBob

    TCEBob Guest

    This doesn't work:

    (setq stnd(tblsearch "STYLE" "STANDARD"))
    (setq stnd(subst (cons 3 "simplex") (assoc 3 stnd) stnd))
    (entmod stnd)

    How does one modify / add /delete items in a table?

    Hints welcome.

    rs
     
    TCEBob, Jan 19, 2005
    #1
  2. TCEBob

    T.Willey Guest

    The activeX way. That is how I do it.

    Tim

    (setq ActDoc (vla-get-ActiveDocument (vlax-get-Acad-Object)))
    (setq StyCol (vla-get-TextStyles ActDoc))
    (setq Stnd (vla-Item StyCol "STANDARD"))
    (vla-put-fontFile Stnd "simplex.shx")
     
    T.Willey, Jan 19, 2005
    #2
  3. TCEBob

    Jeff Mishler Guest

    Bob, note the differences in the following lists and remember that (entmod)
    requires a list that includes the <ename> of the entity to mod, then you
    make the call which one you should be modifying ..... ;-)

    _$ (setq stnd(tblsearch "STYLE" "STANDARD"))
    ((0 . "STYLE") (2 . "STANDARD") (70 . 0) (40 . 0.0) (41 . 1.0) (50 . 0.0)
    (71 . 0) (42 . 0.2) (3 . "simplex.shx") (4 . ""))

    _$ (setq stnd (entget (tblobjname "STYLE" "STANDARD")))
    ((-1 . <Entity name: 400f3ca0>) (0 . "STYLE") (330 . <Entity name:
    400f3c40>) (5 . "77C2BFCE27833454") (100 . "AcDbSymbolTableRecord") (100 .
    "AcDbTextStyleTableRecord") (2 . "STANDARD") (70 . 0) (40 . 0.0) (41 . 1.0)
    (50 . 0.0) (71 . 0) (42 . 0.2) (3 . "simplex.shx") (4 . ""))
    _$
     
    Jeff Mishler, Jan 19, 2005
    #3
  4. TCEBob

    Paul Turvill Guest

    Scratch that ... it's (entget) with (tblobjname), not (tblsearch):

    (setq stnd (entget (tblobjname "style" "standard"))
    stnd (subst (cons 3 "simplex")(assoc 3 stnd) stnd)
    )
    (entmod stnd)
    ___
     
    Paul Turvill, Jan 19, 2005
    #4
  5. TCEBob

    Adesu Guest

    Hi T.Willey ,would you correction my code,this code not yet work,here code

    (setq ao (vlax-get-acad-object))
    (setq ad (vla-get-ActiveDocument ao))
    (setq ds (vla-get-DimStyles ad))
    (setq dlc (vla-item ds "DimensionLineColor"))
    (vla-put-DimensionLineColor dlc 'color 1)
     
    Adesu, Jan 19, 2005
    #5
  6. TCEBob

    TCEBob Guest

    Thank you all! I did not realize that there is an entity behind a table item.
    You have done your day's work and can all adjourn to the nearest public house,
    where I might drop in and stand a round.

    rs
     
    TCEBob, Jan 19, 2005
    #6
  7. TCEBob

    Tom Smith Guest

    (setq stnd (entget (tblobjname "style" "standard"))
    Paul, FWIW I usually skip the second setq in a case like that and do:

    (setq stnd (entget (tblobjname "style" "standard")))
    (entmod (subst (cons 3 "simplex")(assoc 3 stnd) stnd))
     
    Tom Smith, Jan 19, 2005
    #7
  8. TCEBob

    T.Willey Guest

    Sorry I don't know that one off hand, and I don't have time right now to look at it for you. Maybe someone who knows will post.

    Tim
     
    T.Willey, Jan 19, 2005
    #8
  9. TCEBob

    Jeff Mishler Guest

    Ade, dimension styles behave quite differently than other Table objects.
    From the help file for DimStyles:
    The active dimension style determines the appearance of new dimensions
    created in the drawing. To change the style of an existing dimension, use
    the StyleName property found on the dimension.

    To control the settings of the current document overrides, use the
    dimensioning system variables. SeeSystem Variables in the AutoCAD Command
    Reference for a list of dimensioning system variables.

    When you change a dimensioning system variable you are actually setting a
    document override for the active dimension style, you are not changing the
    active dimension style itself. This means that all newly created dimensions
    will still be created with active dimension style only and will not reflect
    the overrides from the system variables. The overrides from the system
    variables will not be recognized on new dimensions until the active
    dimension style is updated. To change the settings of any dimension style,
    use the CopyFrom method. This method copies a dimension style configuration,
    including overrides, from a document, dimension, or other dimension style.

    Dimensions created via the AutoCAD user interface are created with the
    active dimension style plus all document overrides. Dimensions created via
    ActiveX are created with the active dimension style only. To have the
    dimensions created via ActiveX take on the document overrides use the
    CopyFrom method to copy the dimension style from the document to the active
    dimension style. This process will copy all existing overrides into the
    active dimension style.
     
    Jeff Mishler, Jan 19, 2005
    #9
  10. TCEBob

    Adesu Guest

    Hi Jeff,the first thanks a lot for reply and comment,then I got from


     
    Adesu, Jan 20, 2005
    #10
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.