+ Reply to Thread
Results 1 to 10 of 10
  1. #1
    Full Member
    Discipline
    Manufacture
    Using
    AutoCAD 2014
    Join Date
    Oct 2017
    Posts
    39

    Default (ssget "_p") issue

    Registered forum members do not see this ad.

    Code:
    (setq axd (vla-AddDimAligned spc d1 d2 ex))
    (vla-Copy axd)
    (vl-cmdf "_.explode" "_l" "") ;could not find an ActiveX equivalent for this
    (setq del (ssget "_p")) ;errors here, does not set the variable and exits routine
    Can someone shed some light? What is the deal with the above?
    I am able to type the last expression at the command line after error and it sets the variable fine, so it seems to recognize the previous entities after lisp exits but not during for some reason.

    Also, is there a way to explode dims other than the command method?

    Thanks in advance!

  2. #2
    Super Member
    Discipline
    Multi-disciplinary
    Using
    AutoCAD 2015
    Join Date
    Nov 2013
    Posts
    1,447

    Default

    Try with:

    Code:
    (setq e (entlast))
    (setq axd (vla-AddDimAligned spc d1 d2 ex))
    (command "_.EXPLODE" (ssadd (vlax-vla-object->ename axd))  "")
    (setq SS (ssadd))
    (while (setq e (entnext e)) (ssadd e SS))
    (sssetfirst nil SS)
    Looks like IAcadDimAligned doesn't have Explode method, so you'll have to stick with the command approach.

  3. #3
    Full Member
    Discipline
    Manufacture
    Using
    AutoCAD 2014
    Join Date
    Oct 2017
    Posts
    39

    Default

    That did it Grrr... million thanks.. I'm was even able to iterate and process selection without the need for ssget or ssadd thanks to your tip! Bummer about the explode command... though..

  4. #4
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Win 7 Pro / Win 10 Pro / Linux Mint
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2018
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    19,533

    Default

    Exploding dimensions!?!
    Lee Mac ProgrammingTwitterExchange App StoreDropbox (500MB free)

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

  5. #5
    Full Member
    Discipline
    Manufacture
    Using
    AutoCAD 2014
    Join Date
    Oct 2017
    Posts
    39

    Default

    I was waiting for that...

    Exploding the copy of the original to be fair...

    Only to extract the arrow blocks and manipulate them to look like they are in isometic view... working on iso projection dimensioning...

  6. #6
    Super Member
    Discipline
    Multi-disciplinary
    Using
    AutoCAD 2015
    Join Date
    Nov 2013
    Posts
    1,447

    Default

    I tought the same as Lee,
    Alternatively would be to extract the Arrowhead1Block and Arrowhead2Block properties and insert the blocks at ExtLine1Point and ExtLine2Point property-points (or something like this).
    I would be careful when using Explode, so I'd use Undomarks/*error* function in my routine.

  7. #7
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Win 7 Pro / Win 10 Pro / Linux Mint
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2018
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    19,533

    Default

    Quote Originally Posted by eimimitu View Post
    Only to extract the arrow blocks and manipulate them to look like they are in isometic view... working on iso projection dimensioning...
    You could alternatively iterate over the dimension block definition, e.g.:
    Code:
    (defun c:test ( / blk ent enx )
        (if
            (and
                (setq ent (car (entsel "\nSelect dimension: ")))
                (setq enx (entget ent))
                (wcmatch (cdr (assoc 0 enx)) "*DIMENSION")
                (setq blk (tblobjname "block" (cdr (assoc 2 enx))))
            )
            (while (setq blk (entnext blk))
                (print (cdr (assoc 0 (entget blk))))
            )
        )
        (princ)
    )
    Also refer to my LM:getdimstring function.
    Lee Mac ProgrammingTwitterExchange App StoreDropbox (500MB free)

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

  8. #8
    Full Member
    Discipline
    Manufacture
    Using
    AutoCAD 2014
    Join Date
    Oct 2017
    Posts
    39

    Default

    I considered this approach... Only issue is that most commonly used arrowhead is "Closed Filled" which, in my version of ACAD at least, is not a block definition at all but a solid... Any suggestions for solving this?

    So instead of vla-getting Arrowhead1or2Block, inserting it on screen and modifying it, I opted for exploding a copy of the final dimension, extracting arrows and erasing/purging all the leftovers... Not ideal because of having to call the command but works pretty good. I'm also forced to call other commands, specifically "DIMALIGNED" because vla-AddDimAligned doesn't create an object associated dimension as far as I understand. I also could not find any method to associate after creation as in the "DIMREACCOSIATE" command.

    A bit off topic but, quick question for you lisp masters..
    What can you tell me about stacked fractions in fields...
    As far as I know there's no standard option for this...
    Theoretical solution which I haven't really looked into is Diesel Expressions in combo with Formatting Codes (Lee's routine reminded me of it)
    Uses would be:
    Viewport scale, Height of an Extrusion, Coordinate Point Position and such
    I want to be able to match standard format for my drawings which is all fractions stacked
    I want to use fields for its auto update capability
    Any workaround that you can think of?
    Just thought of another theoretical solution: Fields to mtext string in combo with object reactor???? (just spitball-ing but..)

  9. #9
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Win 7 Pro / Win 10 Pro / Linux Mint
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2018
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    19,533

    Default

    Quote Originally Posted by eimimitu View Post
    I considered this approach... Only issue is that most commonly used arrowhead is "Closed Filled" which, in my version of ACAD at least, is not a block definition at all but a solid... Any suggestions for solving this?
    You misunderstood.

    I am not referring to the block definition of the arrowhead, but the block definition of the dimension itself - this will apply to all dimensions, regardless of the arrowhead used.

    Did you try my code with your dimensions?
    Lee Mac ProgrammingTwitterExchange App StoreDropbox (500MB free)

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

  10. #10
    Full Member
    Discipline
    Manufacture
    Using
    AutoCAD 2014
    Join Date
    Oct 2017
    Posts
    39

    Default

    Registered forum members do not see this ad.

    ooh I think I'm following now... you're approach iterates to the original dimension without needing to explode it... then it's a matter of extracting the needed entities from the block definition itself.. Yes?

    what method would you use to extract arrows...?

    Code:
    (vla-copy (vlax-ename->vla-object blk))

Similar Threads

  1. Ssget with option "C" and -4 code filters. Unable to select.
    By MJLM in forum AutoLISP, Visual LISP & DCL
    Replies: 5
    Last Post: 17th Jun 2016, 08:03 am
  2. ssget "x" act differently in command line vs console/lisp?
    By Jef! in forum AutoLISP, Visual LISP & DCL
    Replies: 6
    Last Post: 6th Feb 2015, 12:26 am
  3. Text Issue: Plotting "W" & "M"
    By PaulS00 in forum AutoCAD 2D Drafting, Object Properties & Interface
    Replies: 16
    Last Post: 10th Jul 2013, 09:02 pm
  4. Help needed with "ssget filter for inserts with specific attribute tags"
    By MarcoW in forum AutoLISP, Visual LISP & DCL
    Replies: 8
    Last Post: 9th Jun 2011, 03:42 pm
  5. (ssget "+.:S:N" '((0 . "ACAD_TABLE")))) ?
    By muthu123 in forum AutoLISP, Visual LISP & DCL
    Replies: 2
    Last Post: 14th Jul 2010, 01:06 pm

Tags for this Thread

Bookmarks

Posting Permissions

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