A question for Tony T

Discussion in 'AutoCAD' started by Jamie Duncan, Jan 25, 2004.

  1. Jamie Duncan

    Jamie Duncan Guest

    Tony, in the recent float lisp thread you mentioned that entxxxx lisp is
    dead. Could you clarify to someone like me, who can lisp around a bit but
    has nowhere near the level of knowledge or proficiency you possess?

    is lisp a dead end?

    what language should I be using, or learning about?

    you don't sound very happy about activex either, is that something best left
    alone?

    We have hundreds of very useful lisps specially tailored to our work - are
    you saying that I have to look at porting these to another language?


    Thank you.
     
    Jamie Duncan, Jan 25, 2004
    #1
  2. Autodesk has already made it clear that they're not going
    continue supporting the (entxxxx) style functions for accessing
    and modifying entity data. In fact, newer releases of some
    vertical products do not even support it, and the only way to
    access the custom objects in those applications is via their
    ActiveX interfaces.

    While you can continue to do relatively simple programming
    with that style of coding, it is obsolete and certainly does
    not have any future. Considering how cryptic DXF codes are,
    I can't see why anyone would want to program that way any
    longer, given the ActiveX API, but in LISP, the syntax is a
    bit convoluted, and you have to write a lot more code (the
    advantage is that it is more explicit and therefore makes the
    intent of the code much clearer, at the expense of brevity).

    ActiveX is fine if you use VBA or another imperative language
    with a rational OOP syntax, but for LISP it is simply not my
    preferred way to code.

    The point to the comment about the entxxxx style of LISP
    coding, is that someone was using it to "copy" entities,
    but didn't realize that it was not really doing that, and
    hence, could have undesireable effects in some circumstances.
     
    Tony Tanzillo, Jan 25, 2004
    #2
  3. Jamie Duncan

    Doug Broad Guest

    To add to what Tony said, comments from Autodesk personnel
    regarding the vertical product (ADT) indicate that if you want to develop
    for that application, you must use ARX(C++) in order to gain access
    to ADT objects and methods. There is a software development kit
    available using C++. The activeX interface for ADT is either too basic or
    deliberately disabled such that it is extremely difficult for the end
    user to improve the ADT product with those tools.

    I was disappointed, for example, with the flexibility of how wall trimmed
    ACAD entities. After looking at the ActiveX interface for getting
    wall component information, I gave up and had to use a ridiculously
    complicated (entget) sequence to obtain that component information.

    The help files for the ADT object model state:
    "Most wall style properties are not yet exposed through ActiveX."

    I would suspect that these properties will only be exposed when
    Autodesk has completed its development cycle of ADT and has
    moved on to other technologies. Either Autodesk does not
    want to risk end users becoming potentital competitors or it can't
    afford to spend the time to make ActiveX tools available for
    objects that are changing rapidly with each release.

    Regards,
    Doug
     
    Doug Broad, Jan 25, 2004
    #3
  4. Jamie Duncan

    Jamie Duncan Guest

    Dear Tony,

    Thank you for your detailed reply. I read all the way through the float
    discussion and understood that the entmake function won't copy the
    dictionaries.

    I started to learn vba, and saw the potential for easy dialogue boxes, but I
    stumbled over the issues of default values, and the fact that I had never
    learned any of the 'Visual' type of programming.

    If someone like me wanted to get started in the right direction, I assume
    that rewriting some of my simpler lisps into VBA would be the best way to
    go?

    Thanks


    Jamie Duncan
     
    Jamie Duncan, Jan 25, 2004
    #4
  5. Jamie Duncan

    Jamie Duncan Guest

    Thank you Doug. Unfortunately from my perspective that muddies the waters
    even more. We don't use ADT, we have an in-house system whose technology
    may be old, but is directly suited to our work (95% is 2D space planning of
    large metropolitan hospitals).
    I guess we may just have to wait and see on this one, especially with revit
    out there.



    --
    Jamie Duncan

    "How wrong it is for a woman to expect the man to build the world she wants,
    rather than to create it herself."
    - Anais Nin (1903-1977)
     
    Jamie Duncan, Jan 25, 2004
    #5
  6. Jamie Duncan

    Doug Broad Guest

    Thanks James.
    I've had some success digging, as you say, also. Sounds
    like we both have hard enough heads to keep banging away.;-)

    I also heartily agree with your hope that Autodesk never
    abandons the LISP.

    As an end user, like yourself, its rather frustrating though
    to spend time rooting around blindly with virtually no
    documentation to go by with regards to ADT.

    Just to give some of the lurkers an idea of what I'm talking
    about, I attach the entity data from a single short horizontal
    brick wall with no doors or windows or special modifications.

    Command: (entget(car(entsel)))

    Select object: ((-1 . <Entity name: 7efa8ea8>) (0 . "AEC_WALL") (330 . <Entity
    name: 7efa4cf8>) (5 . "1BF5") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8
    .. "A-Wall") (100 . "AecDbEntity") (102 . "{AEC_SUBOBJECT") (300 .
    "AecImpWallLinear") (100 . "AecImpObj") (3 . "") (100 . "AecImpEnt") (171 . 0)
    (100 . "AecImpGeo") (10 70.125 284.188 0.0) (15 1.0 0.0 0.0) (16 0.0 1.0 0.0)
    (210 0.0 0.0 1.0) (360 . <Entity name: 0>) (100 . "AecImpWall") (102 .
    "{AEC_SUBOBJECT") (300 . "AecWallCutLine") (100 . "AecImpObj") (3 . "") (100 .
    "AecWallCutLine") (71 . 1) (102 . "{AEC_WALLCUTLINE_ANCHORS") (100 .
    "AecImpObj") (3 . "") (100 . "AecImpArray") (90 . 2) (102 . "{AEC_SUBOBJECT")
    (300 . "AecWallCutLineAnchor") (100 . "AecImpObj") (3 . "") (100 .
    "AecWallCutLineAnchor") (40 . 0.0) (41 . 0.0) (70 . 0) (71 . 2) (102 .
    "AEC_SUBOBJECT}") (102 . "{AEC_SUBOBJECT") (300 . "AecWallCutLineAnchor") (100
    .. "AecImpObj") (3 . "") (100 . "AecWallCutLineAnchor") (40 . 0.0) (41 . 0.0)
    (70 . 1) (71 . 2) (102 . "AEC_SUBOBJECT}") (102 . "AEC_WALLCUTLINE_ANCHORS}")
    (102 . "AEC_SUBOBJECT}") (102 . "{AEC_SUBOBJECT") (300 . "AecWallCutLine") (100
    .. "AecImpObj") (3 . "") (100 . "AecWallCutLine") (71 . 0) (102 .
    "{AEC_WALLCUTLINE_ANCHORS") (100 . "AecImpObj") (3 . "") (100 . "AecImpArray")
    (90 . 2) (102 . "{AEC_SUBOBJECT") (300 . "AecWallCutLineAnchor") (100 .
    "AecImpObj") (3 . "") (100 . "AecWallCutLineAnchor") (40 . 0.0) (41 . 0.0) (70
    .. 0) (71 . 7) (102 . "AEC_SUBOBJECT}") (102 . "{AEC_SUBOBJECT") (300 .
    "AecWallCutLineAnchor") (100 . "AecImpObj") (3 . "") (100 .
    "AecWallCutLineAnchor") (40 . 0.0) (41 . 0.0) (70 . 1) (71 . 7) (102 .
    "AEC_SUBOBJECT}") (102 . "AEC_WALLCUTLINE_ANCHORS}") (102 . "AEC_SUBOBJECT}")
    (40 . 96.0) (73 . 3) (42 . 8.0) (341 . <Entity name: 7efa8e78>) (74 . 2) (43 .
    0.0) (102 . "{AEC_WALL_MODIFIERS") (100 . "AecImpObj") (3 . "") (100 .
    "AecImpArray") (90 . 0) (102 . "AEC_WALL_MODIFIERS}") (102 .
    "{AEC_WALLSTYLE_OVERRIDES") (100 . "AecImpObj") (3 . "") (100 . "AecImpArray")
    (90 . 0) (102 . "AEC_WALLSTYLE_OVERRIDES}") (102 . "{AEC_WALL_INTERFERENCE")
    (100 . "AecImpObj") (3 . "") (100 . "AecImpArray") (90 . 0) (102 .
    "AEC_WALL_INTERFERENCE}") (343 . <Entity name: 7efa8d78>) (102 .
    "{AEC_WALL_MERGERS") (100 . "AecImpObj") (3 . "") (100 . "AecImpArray") (90 .
    0) (102 . "AEC_WALL_MERGERS}") (102 . "{AEC_WALL_CUSTOM_GEOMETRY") (100 .
    "AecImpObj") (3 . "") (100 . "AecImpArray") (90 . 0) (102 .
    "AEC_WALL_CUSTOM_GEOMETRY}") (100 . "AecImpWallLinear") (102 . "{ACGECURVE3D")
    (280 . 3) (10 70.125 284.188 0.0) (10 209.563 0.0 0.0) (102 . "ACGECURVE3D}")
    (210 0.0 0.0 1.0) (102 . "AEC_SUBOBJECT}") (102 . "{AEC_NULLOBJECT}") (100 .
    "AecDbGeo") (100 . "AecDbWall"))

    If for example, I wanted to recreate a wall with entmake, I'd be
    quite lost. Deciphering this does not seem "end-user" practical.
    It therefore puts all users on an equal footing with only their
    knowledge of the ADT UI being the only leverage.

    As a teacher, I have to try to predict what will be
    around 5-10 years down the line so that I will know
    what to teach them to maximize their success. In the
    small town of Rocky Mount, NC architects are
    using (ADT, Archicad, DataCAD, plain AutoCAD, AutoCAD
    LT, Microstation...). (Nobody is on Revit yet). With the
    ADT learning curve being 3-6 months IMO,
    I could be teaching students a lot of useless stuff if
    local architects don't go with ADT. Even Autodesk
    wafflles about ADT's long term future.

    5 years ago, Autodesk was an obvious choice and
    customization knowledge an obvious help. Today
    my crystal ball has been muddied so that I have know
    idea what's next and what will be best to teach.

    Thanks for your comments.

    Regards,
    Doug
     
    Doug Broad, Jan 26, 2004
    #6
  7. Jamie Duncan

    David Bethel Guest

    Jamie,

    I've been hearing AutoLISP is dead for many a year. It is still the
    best ACAD customization tool that works cross platform. There are work
    arounds for the absent DXF codes that have been mentioned. They have
    always been there.

    Use the tool that is right for you, not always the one recommended to
    you. No one knows what you needs are better than you. Also, your
    comfort level and programming abilities come into the formula.

    I still use R12 DOS as my base platform. It is my most efficient
    combination in my particular discipline. -David
     
    David Bethel, Jan 26, 2004
    #7
  8. Jamie Duncan

    James Buzbee Guest

    Doug,

    Dean McCarns, myself, and a few others have been successfully customizing
    ADT with plain ole lisp (think R14 Visual Lisp). Everything you need to
    modify the ADT Object Model is right there, exposed to Lisp through either
    Activex or dictionaries, you just have to do some digging.

    I hope AutoDesk never abandones lisp. I'm NOT a programmer - I'm a user.
    If it wasn't for VisuaLISP (and ObjectDCL) I'd be up the preverbial creek
    without the proverbial paddle.

    jb
     
    James Buzbee, Jan 26, 2004
    #8
  9. Jamie Duncan

    Dan Guest

    Maybe not a good Idea to put alot of time and effort into learning VBA
    either.
    Microsoft has already announced that VB6 is going away and is being replaced
    with .NET.
    I'm not a professional programmer and I don't have enough time to learn a
    new
    language every 5-years. I sure hope Vlisp stays 'till I retire at least!
     
    Dan, Jan 26, 2004
    #9
  10. Jamie Duncan

    Doug Broad Guest

    James,
    Thanks for the illustration. That seems practical
    for the average customizer. I see what you
    mean about R14 visual lisp.

    Regards,
    Doug
     
    Doug Broad, Jan 26, 2004
    #10
  11. does 'no support' mean a user would have to convert existing ENTXXX code to
    ACTIVEX?
    supporting the (entxxxx) style functions for accessing and modifying entity
    data.
     
    the aec industry is dysfunctional, Jan 26, 2004
    #11
  12. Most likely, it means that there's not going to be
    DXF support for any new properties or objects that
    are added.
     
    Tony Tanzillo, Jan 26, 2004
    #12
  13. thanks
     
    the aec industry is dysfunctional, Jan 26, 2004
    #13
  14. Jamie Duncan

    James Buzbee Guest

    If for example, I wanted to recreate a wall with entmake . . .

    The better way - but still good ole lisp. Notice how I get ActiveX stuff:

    (setq acad(vlax-get-acad-object)
    thisDrawing(vlax-get acad "activedocument")
    modelspace(vlax-get thisDrawing "modelspace"))

    ;select a wall to match style

    (setq wallstyle(vlax-get (vlax-ename->vla-object(car(entsel "\nSelect a
    Wall: ")))"stylename")
    p1(getpoint "\nWall start point: ")
    p2(getpoint "\nWall end point: "))

    ;create the wall
    (setq newwall(vlax-invoke modelspace "AddCustomObject""AecWall"))

    ; apply properties
    (vlax-put newwall "startpoint" p1)
    (vlax-put newwall "endpoint" p2)
    (vlax-put newwall "stylename" wallstyle)

    Thanks to Dean McCarns for discovering the ADT Object Model prefers to be
    modified via vlax-put, vlax-get, and vlax-invoke. These functions don't
    expect a certain return as do the vla- and vlax-get-property functions.
    They accept whatever the object throws - so you don't see the exception in
    some instances.

    jb
     
    James Buzbee, Jan 26, 2004
    #14
  15. Jamie Duncan

    Fred Schreck Guest

    James:

    What other properties be applied to the wall using this method, other than
    the style?
    The obvious ones would be height, width and justification....

    I've extended your code example, and can get "width", but not "height" or
    "justification"....

    Thanks,

    Fred Schreck
    KMD Architects
    San Francisco

    -----------------------------------------------------------------------
    CODE SAMPLE

    (defun C:ADDWALLSELECTED ( )

    (setq acad (vlax-get-acad-object)
    thisDrawing (vlax-get acad "activedocument")
    modelspace (vlax-get thisDrawing "modelspace")
    );setq

    ;; select a wall to match style

    (setq wallobj (vlax-ename->vla-object (car (entsel "\nSelect a Wall: "))))

    (setq wallstyle (vlax-get wallobj "stylename"))
    (setq wallwidth (vlax-get wallobj "width")) ;; works!!!
    (setq wallheight (vlax-get wallobj "height")) ;; doesn't work
    (setq walljust (vlax-get wallobj "justification")) ;; doesn't work

    (setq p1 (getpoint "\nWall start point: "))
    (setq p2 (getpoint p1 "\nWall end point: "))

    ;create the wall

    (setq newwall (vlax-invoke modelspace "AddCustomObject" "AecWall"))

    ;; apply properties

    (vlax-put newwall "startpoint" p1)
    (vlax-put newwall "endpoint" p2)
    (vlax-put newwall "stylename" wallstyle)
    (vlax-put newwall "width" wallwidth) ;; works!!!

    (vlax-put newwall "height" wallheight) ;; doesn't work
    (vlax-put newwall "justification" walljust) ;; doesn't work

    );defun



    (princ)
     
    Fred Schreck, Jan 26, 2004
    #15
  16. Jamie Duncan

    Fred Schreck Guest

    James:

    I dug some more, and found the answer... "baseheight" and "justify".
    Thanks for sharing your code- I learned something useful.

    ----------------------------------------------------------------------------
    ----
    Here's the sample code:

    (defun C:ADDWALLSELECTED ( )

    (setq acad (vlax-get-acad-object)
    thisDrawing (vlax-get acad "activedocument")
    modelspace (vlax-get thisDrawing "modelspace")
    );setq

    ;; select a wall to match style

    (setq wallobj (vlax-ename->vla-object (car (entsel "\nSelect a Wall: "))))

    (setq wallstyle (vlax-get wallobj "stylename"))
    (setq wallwidth (vlax-get wallobj "width"))
    (setq wallheight (vlax-get wallobj "baseheight"))
    (setq walljust (vlax-get wallobj "justify"))

    (setq p1 (getpoint "\nWall start point: "))
    (setq p2 (getpoint p1 "\nWall end point: "))

    ;create the wall

    (setq newwall (vlax-invoke modelspace "AddCustomObject" "AecWall"))

    ;; apply properties

    (vlax-put newwall "startpoint" p1)
    (vlax-put newwall "endpoint" p2)
    (vlax-put newwall "stylename" wallstyle)
    (vlax-put newwall "width" wallwidth)
    (vlax-put newwall "baseheight" wallheight)
    (vlax-put newwall "justify" walljust)

    );defun

    (princ)

    ----------------------------------------------------------------------------
    -------------------------
    For anybody that's interested, here's the wall property names extracted from
    a sample wall object:

    ; Application (RO) = #<VLA-OBJECT IAcadApplication 00a8a730>
    ; BaseHeight = 96.0
    ; Cleanup = -1
    ; CleanupGroup = #<VLA-OBJECT IAecCleanupGroup 07880bc0>
    ; CleanupGroupName = "Standard"
    ; CleanupRadius = 0.0
    ; Color = 256
    ; Description = ""
    ; Document (RO) = #<VLA-OBJECT IAcadDocument 0105b8cc>
    ; EndCleanupRadius = 0.0
    ; EndEndcapStyle = #<VLA-OBJECT IAecEndcapStyle 07880af0>
    ; EndPoint = (1266.92 426.572 0.0)
    ; Handle (RO) = "1A2"
    ; HasExtensionDictionary (RO) = 0
    ; Hyperlinks (RO) = #<VLA-OBJECT IAcadHyperlinks 07880ab4>
    ; Justify = 3
    ; Layer = "0"
    ; Length = 414.429
    ; Linetype = "ByLayer"
    ; LinetypeScale = 1.0
    ; Lineweight = -1
    ; Location = (852.49 426.572 0.0)
    ; MidPoint = (1059.7 426.572 0.0)
    ; Modifiers (RO) = #<VLA-OBJECT IAecWallModifiers 07880700>
    ; Normal = (0.0 0.0 1.0)
    ; ObjectID (RO) = 1075886544
    ; ObjectName (RO) = "AecDbWall"
    ; OwnerID (RO) = 1074445560
    ; PlotStyleName = "ByLayer"
    ; Radius = 0.0
    ; Rotation = 0.0
    ; StartCleanupRadius = 0.0
    ; StartEndcapStyle = #<VLA-OBJECT IAecEndcapStyle 07880af0>
    ; StartPoint = (852.49 426.572 0.0)
    ; Style = #<VLA-OBJECT IAecWallStyle 07880570>
    ; StyleName = "Standard"
    ; Visible = -1
    ; Width = 24.0

    ----------------------------------------------------------------------------
     
    Fred Schreck, Jan 26, 2004
    #16
  17. Jamie Duncan

    John Uhden Guest

    Same's true for Land Desktop. The dictionaries actually hold everything in
    terms of drawing variables. Though they are not documented, a little T&E
    reveals the DXF structure. This of course is what Autodesk does NOT want us to
    know... how to access vertical data without the vertical application present
    (read "paid for"). They've done a marvelous job in this respect in the 2004
    edition of verticals. You really *can't* access custom object data without the
    application present. Very clever.

    The sad part is that the ActiveX methods/properties are not all revealed even if
    you've paid for the application. Okay, skip the vertical arguments... Tell me
    how with ActiveX you can easily find what leader(s) is/are attached to an MTEXT
    without filtering through every leader and checking its Annotation object. Tell
    me how you can easily separate polyline control vertices from actual vertices
    without DXF codes. Tell me how you can create/modify a linetype without DXF
    codes. Either they provide the ActiveX methods/properties or it's one giant
    step backwards for add-ons to improve their own software. The original reason I
    selected AutoCAD as the base CAD engine in 1988 was because of its open
    architecture. LDT and ADT wouldn't be here today as Autodesk products if the
    architecture were proprietary. Should we/they read back on the rise and fall of
    the Roman Empire?
     
    John Uhden, Jan 27, 2004
    #17
  18. Jamie Duncan

    James Buzbee Guest

    Fred,
    I'm glad you found this useful - what it's all about!

    jb
     
    James Buzbee, Jan 27, 2004
    #18
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.