Where are the brains here?

Discussion in 'AutoCAD' started by Bruce Sheldon, May 11, 2004.

  1. Earlier I wrote:

    There are some flags set at in a certain variable that can be query'd to
    determine what layers a frozen in the current viewport. I cannot for the
    life of me remember where they are, but it seems there were some unused
    flags in order versions of AutoCAD that got "recruited" for the job,
    possibly in the layers table. Can someone please enlighten me?

    Then I added:

    Sure wish I would have saved this procedure way back when. It's nothing
    short of incredible that this is so obscure! It's so simple to get the
    "global" layer settings and do whatever one wishes, but obtaining the
    vplayer settings seems impossible. Where are all the brains in this forum?
    Obviously I can't make the claim!

    Sure hope someone comes to the rescue soon, I really need to be able
    to do this. I'm sure it's going to be a "duh" when it finally comes out,
    but
    I still can't get it.

    Bruce
     
    Bruce Sheldon, May 11, 2004
    #1
  2. Why did you start a new thread?

    --
    R. Robert Bell


    Earlier I wrote:

    There are some flags set at in a certain variable that can be query'd to
    determine what layers a frozen in the current viewport. I cannot for the
    life of me remember where they are, but it seems there were some unused
    flags in order versions of AutoCAD that got "recruited" for the job,
    possibly in the layers table. Can someone please enlighten me?

    Then I added:

    Sure wish I would have saved this procedure way back when. It's nothing
    short of incredible that this is so obscure! It's so simple to get the
    "global" layer settings and do whatever one wishes, but obtaining the
    vplayer settings seems impossible. Where are all the brains in this forum?
    Obviously I can't make the claim!

    Sure hope someone comes to the rescue soon, I really need to be able
    to do this. I'm sure it's going to be a "duh" when it finally comes out,
    but
    I still can't get it.

    Bruce
     
    R. Robert Bell, May 11, 2004
    #2
  3. Bruce Sheldon

    JRWalker Guest

    JRWalker, May 11, 2004
    #3
  4. I thought Michael's comments were adequate
    for answering the question in your first thread.


    PS: Please don't change the subject line when
    posting to existing threads, makes them very
    difficult to follow.
     
    Jason Piercey, May 11, 2004
    #4
  5. Bruce Sheldon

    JRWalker Guest

    Oops. Sorry. I did not pay attention that I was in the customization and not
    the customization.vba group.

    JRWalker
     
    JRWalker, May 11, 2004
    #5
  6. Bruce Sheldon

    Doug Broad Guest

    And practically meaningless. Michael answered the original question.
    There are no "variables".
     
    Doug Broad, May 11, 2004
    #6
  7. Bruce Sheldon

    Devin Guest

    Perhaps you're trying to provoke an answer by insult? I can testify that
    there are plenty of brains in this forum and a lot of them are answering
    you.

    Devin
     
    Devin, May 11, 2004
    #7
  8. Bruce Sheldon

    Rudy Tovar Guest

    Probably to see who he could con into doing it or show him how...

    Where did, and how did he post the first one?

    Too much sweet talk...to soften anyone...
     
    Rudy Tovar, May 11, 2004
    #8
  9. Bruce Sheldon

    Devin Guest

    Bruce,

    Based on the brain's responses, I put together this routine that takes an
    object (a paperspace viewport object) and returns it's xdata (where the
    vplayer layers are stored) in the form of a list.

    (defun psvp->xdatalist ( obj / v1 v2 a b lst )
    (vla-GetXData obj "acad" 'v1 'v2)
    (if
    (= (type v1) 'safearray)
    (setq v1 (vlax-safearray->list v1))
    )
    (if
    (= (type v2) 'safearray)
    (setq v2 (vlax-safearray->list v2))
    )
    (mapcar
    '(lambda (a b)
    (if
    (= (type a) 'variant)
    (setq a (vlax-variant-value a))
    )
    (if
    (= (type b) 'variant)
    (setq b (vlax-variant-value b))
    )
    (if
    (= (type a) 'safearray)
    (setq a (vlax-safearray->list a))
    )
    (if
    (= (type b) 'safearray)
    (setq b (vlax-safearray->list b))
    )
    (setq lst (append lst (list (list a b))))
    )
    v1 v2
    )
    lst
    )

    HTH,

    Devin
     
    Devin, May 11, 2004
    #9
  10. In this ng, earlier today. <sigh>


    --
    R. Robert Bell


    Probably to see who he could con into doing it or show him how...

    Where did, and how did he post the first one?

    Too much sweet talk...to soften anyone...
     
    R. Robert Bell, May 11, 2004
    #10
  11. Bruce Sheldon

    Devin Guest

    and here's an example of what it returns...

    (psvp->xdatalist obj)
    ((1001 "ACAD") (1000 "MVIEW") (1002 "{") (1070 16) (1010 (0.0 0.0 0.0))
    (1010
    (0.0 0.0 1.0)) (1040 0.0) (1040 9.22547) (1040 6.0) (1040 4.5) (1040 50.0)
    (1040 0.0) (1040 0.0) (1070 0) (1070 1000) (1070 1) (1070 3) (1070 0) (1070
    0)
    (1070 0) (1070 0) (1040 0.0) (1040 0.0) (1040 0.0) (1040 0.5) (1040 0.5)
    (1040
    0.5) (1040 0.5) (1070 0) (1002 "{") (1003 "0") (1003 "_DIM") (1003
    "_TBLOCK")
    (1002 "}") (1002 "}"))

    notice the dxf 1003 values, they are the vpfrozen layers of the pvport
    object.
     
    Devin, May 11, 2004
    #11
  12. Bruce Sheldon

    Rudy Tovar Guest

    Ah!, I overlooked it...

    Hey, he must have copyclipped pieces to build this new post.

    Still, if he's assuming that perhaps someone else has a better answer...

    Both combination of assoc 70 and 62 will tell him whether a layer is frozen,
    off, on, thawed, viewport or not. etc...
     
    Rudy Tovar, May 11, 2004
    #12
  13. Bruce Sheldon

    Devin Guest

    Hi Luis,

    I'm not sure what muy bien means. I'm so bad at spanish, even though I took
    it in highschool.
     
    Devin, May 11, 2004
    #13
  14. Customization.IgnoreList.Add( GetThreadAuthor( http://tinyurl.com/2zk5w ));
    Customization.DeletePosts( IgnoreList );
    Customization.Compact( );
     
    michael puckett, May 12, 2004
    #14
  15. http://tinyurl.com/2zk5w ));
    Er, shouldn't that be for the Customization.VBA group? Maybe this instead:

    (setq IgnoreList (vlax-get-property Customization 'IgnoreList))
    (vlax-invoke-method IgnoreList 'Add (GetThreadAuthor
    "http://tinyurl.com/2zk5w"))
    (vlax-invoke-method Customization 'DeletePosts IgnoreList)
    (vlax-invoke-method Customization 'Compact)

    ;;vl-load-com and Customization initialization code left out for readability

    Cheers,

    -Rick Francken
     
    Rick Francken, May 12, 2004
    #15
  16. Bruce Sheldon

    Devin Guest

    Well then, thank you very much!
     
    Devin, May 12, 2004
    #16
  17. Bruce Sheldon

    Devin Guest

    michael puckett,
    http://tinyurl.com/2zk5w ));
    I think you left out the very important property of the (GetThreadAuthor)
    domain is www.SelfInflict.com
     
    Devin, May 12, 2004
    #17
  18. AH! THANKS ALL!

    Didn't mean to come on so strong, but I've posted this problem a few times
    before. Yes, now I remember. The combination of the 2 DXF codes 62 and 70.

    Rudy gets the prize! Oh, oops, sorry, I don't have a prize, but many
    thanks.

    BTW, I love this forum. So many good answers from many people a whole lot
    smarter than me!

    Bruce
     
    Bruce Sheldon, May 12, 2004
    #18
  19. Glad you are happy, but the combination of
    62 and 70 is not going to tell you anything
    about the viewport.
     
    Jason Piercey, May 12, 2004
    #19
  20. Ok Bruce,
    I had to dig up these oldies, but goodies, and piece them together for you.
    Simply provide the GetFrozenLayers function a floating paper space viewport
    object and it will give you a list of layers frozen in it.

    (GetFrozenLayers (vlax-ename->vla-object (car (entsel "\nSelect a floating
    viewort:"))))

    ;;;Arguments - ActiveX Viewport object
    ;;;Retval - A list of layer names that are frozen
    ;;;in a viewport ("A-Anno-Ttlb" "A-Anno-Dims" "A-Anno-Note"
    "A-Anno-RoomTitles")
    ;;;nil if no layers are frozen
    (defun GetFrozenLayers (vlaViewport)
    (mapcar 'cdr (massoc (vla:getXdata vlaViewport "ACAD") 1003))
    )


    ;;;Retrieve XData and convert to a list
    ;;;Arguments - ActiveX object and appID of registered xdata app
    ;;;Retval - eed list
    (defun Vla:GetXData (vlaObj AppID / xType XData)
    (vla-getxdata vlaObj AppID 'xType 'xData)
    (mapcar '(lambda (key val) (cons key (lisp-value val)))
    (vlax-safearray->list xType)
    (vlax-safearray->list xData)
    )
    )


    ;;;My version of massoc
    ;;;The keys are left with the data
    ;;;but can easily be removed with:
    ;;;(mapcar 'cdr (massoc lst key))
    (defun assoc (lst key)
    (vl-remove-if-not '(lambda (x) (= (car x) key)) lst)
    )


    (defun lisp-value (v)
    ;; Copyright 2002 Vladimir Nesterovsky.
    ;; Free for use by any commercial entity with
    ;; less then $100 million annual revenue.
    (cond
    ((= (type v) 'variant)
    (lisp-value (variant-value v)))
    ((= (type v) 'safearray)
    (mapcar 'lisp-value (safearray-value v)))
    (T v)
    )
    )
     
    Bobby C. Jones, May 12, 2004
    #20
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.