+ Reply to Thread
Page 4 of 7 FirstFirst ... 2 3 4 5 6 ... LastLast
Results 31 to 40 of 68
  1. #31
    Senior Member
    Using
    AutoCAD 2010
    Join Date
    Jul 2011
    Posts
    222

    Default

    Registered forum members do not see this ad.

    So looks like im still trying to find something... hehe!! my code changed a little but in the end il only changes last entity. But, since i'm not actually working with and entity i'm not sure where i should be looking next.. i have looked up the help you gave... now 10 months ago But still can't figure it out.

    Anyways ill post what I have atm.

    Code:
    (defun c:test ()
    
      (vl-load-com)
      
      (initget 1 "74m 70m 64m 60m 54m 50m 44m 40m")
      (setq B-Radius(getkword "\n Donner le rayon de la flèche : "))
    
      (setq charge "LC CHARGE 290") 
      (setq C-P "LC C-P 290")
      (setq B-T "LC B-T 290")
    
    
      (foreach fleche (list charge C-P B-T)
             (command"_insert" fleche "1" "0")
              
        (setq fleche (entlast))
        (setq fleche (vlax-ename->vla-object fleche))
        (vlax-dump-object fleche)
        (setq dbp (vla-getdynamicblockproperties fleche))
        (setq dbp (vlax-variant-value dbp))
        (setq dbp (vlax-safearray->list dbp))
        (setq bp (car dbp))
        (vlax-dump-object bp)
        (setq ListeAdmis (vlax-safearray->list (vlax-variant-value (vla-get-AllowedValues bp))))
        (setq ListeAdmis (mapcar 'vlax-variant-value ListeAdmis))
        (vla-put-value bp B-Radius)
      );foreach
    
    
    
    );defun c:
    If I keep it up coffee won't help me anymore haha!! ill get me bottle of Rhum now.
    Attached Files

  2. #32
    Senior Member
    Using
    AutoCAD 2010
    Join Date
    Jul 2011
    Posts
    222

    Default

    And i also forgot to put an insertion point ... thing is im not sure of the insertion point here. I would much rather not have to use insertion. But i would like this routine to locate the blocks in the drawing and then change them.

  3. #33
    Quantum Mechanic ReMark's Avatar
    Computer Details
    ReMark's Computer Details
    Operating System:
    Windows 7 Pro 64-bit
    Computer:
    Thinkmate
    Motherboard:
    Intel DX58SO2 LGA1366 X58
    CPU:
    Intel i7-960 Quad-core 3.20GHz 8MB cache
    RAM:
    12GB (3x4GB) PC3-106000 DDR3
    Graphics:
    nVidia Quadro 4000, 2GB GDDR5
    Primary Storage:
    150GB Velocipraptor 10,000 rpm
    Secondary Storage:
    none
    Monitor:
    Dell P24LLH - 24" wide screen LCD
    Discipline
    See details...
    ReMark's Discipline Details
    Occupation
    CAD Draftsman/Designer...chemical manufacturing.
    Discipline
    See details below.
    Details
    I work for a specialty chemical manufacturer. I do a little bit of everything from P&IDs to civil to architectural and structural.
    Using
    AutoCAD 2013
    Join Date
    Nov 2005
    Location
    Norwalk, CT USofA
    Posts
    33,105

    Default

    I would think, that to locate blocks, an insertion point would be critical unless all your blocks have another unique factor I'm overlooking.
    "I have only come here seeking knowledge. Things they wouldn't teach me of in college." The Police

    Eat brains...gain more knowledge!

  4. #34
    Senior Member
    Using
    AutoCAD 2010
    Join Date
    Jul 2011
    Posts
    222

    Default

    Quote Originally Posted by ReMark View Post
    I would think, that to locate blocks, an insertion point would be critical unless all your blocks have another unique factor I'm overlooking.
    Well the only other thing in commun is mostly their Visibility state. Thats the only thing, other then being in the same drawing

  5. #35
    Senior Member
    Using
    AutoCAD 2010
    Join Date
    Jul 2011
    Posts
    222

    Default

    Lets says they have a specific because theoricly they do. they are placed in a Drawing.dwt. So they never change. So i could create a list using the ucs points of their insertion points if im correct then.

    Code:
    (setq ent1 (entlast))
    then what?...

    And another thing I see in commun is the unit factor which i don't know what it is.. it shows 1

  6. #36
    Senior Member
    Using
    AutoCAD 2010
    Join Date
    Jul 2011
    Posts
    222

    Default

    Hi, Now that i was able to make my lisp a little better would some1 have a way to make it shorter.

    Code:
    (defun c:test ()
    
      (vl-load-com)
    
      (setq pt-charge '(1543860.1543  165437.9249 0))
      (setq pt-c-p '(1551739.6590  165239.6409 0))
      (setq pt-b-t '(1564074.1763  164920.9770 0))
      (setq charge "LC CHARGE 290") 
      (setq C-P "LC C-P 290")
      (setq B-T "LC B-T 290")
    
      (initget 1 "74m 70m 64m 60m 54m 50m 44m 40m")
      (setq B-Radius(getkword "\n Donner le rayon de la flèche : "))
      
      (command "insert" charge pt-charge "1" "1" "0")
      (setq charge (entlast))
      
      (setq charge (vlax-ename->vla-object charge))
      
      (setq dbp (vla-getdynamicblockproperties charge))
      (setq dbp (vlax-variant-value dbp))
      (setq dbp (vlax-safearray->list dbp))
      (setq bp (car dbp))
      
      (setq ListeAdmis (vlax-safearray->list (vlax-variant-value (vla-get-AllowedValues bp))))
      (setq ListeAdmis (mapcar 'vlax-variant-value ListeAdmis))
      (vla-put-value bp B-Radius)
    
      (command "insert" C-P pt-c-p "1" "1" "0")
      (setq C-P (entlast))
      (setq C-P (vlax-ename->vla-object C-P))
      
      (setq dbp (vla-getdynamicblockproperties C-P))
      (setq dbp (vlax-variant-value dbp))
      (setq dbp (vlax-safearray->list dbp))
      (setq bp (car dbp))
      
      (setq ListeAdmis (vlax-safearray->list (vlax-variant-value (vla-get-AllowedValues bp))))
      (setq ListeAdmis (mapcar 'vlax-variant-value ListeAdmis))
      (vla-put-value bp B-Radius)
    
      
      (command "insert" B-T pt-b-t "1" "1" "0")
      (setq B-T (entlast))
      (setq B-T (vlax-ename->vla-object B-T))
      
      (setq dbp (vla-getdynamicblockproperties B-T))
      (setq dbp (vlax-variant-value dbp))
      (setq dbp (vlax-safearray->list dbp))
      (setq bp (car dbp))
      
      (setq ListeAdmis (vlax-safearray->list (vlax-variant-value (vla-get-AllowedValues bp))))
      (setq ListeAdmis (mapcar 'vlax-variant-value ListeAdmis))
      (vla-put-value bp B-Radius)
      
    );defun c:
    To test ir just use the test2.dwg up above

    Thanks for the help.

  7. #37
    Forum Deity BlackBox's Avatar
    Using
    Civil 3D 2011
    Join Date
    Nov 2009
    Posts
    3,948

    Default

    A few observations...

    Localize your variables, consider using vla-InsertBlock Method in lieu of Insert Command, and employ If statement(s) to test for specific criteria, rather than continuing the code regardless of user input (or the lack thereof).
    "Potential has a shelf life." - Margaret Atwood

  8. #38
    Senior Member
    Using
    AutoCAD 2010
    Join Date
    Jul 2011
    Posts
    222

    Default

    Ok Thank ! Now let me see how I can use your information.

    I still have a problem with localizing my variables.. Like on which side to put them.. ( <- / -> )

    On the left side of the / I think i put the Variable that can change during the process and on the right the ones that don't change?

  9. #39
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    15,736

    Default

    Quote Originally Posted by CadFrank View Post
    I still have a problem with localizing my variables.. Like on which side to put them.. ( <- / -> )

    On the left side of the / I think i put the Variable that can change during the process and on the right the ones that don't change?
    http://lee-mac.com/localising.html
    Lee Mac Programming

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

    Just another Swamper

  10. #40
    Senior Member
    Using
    AutoCAD 2010
    Join Date
    Jul 2011
    Posts
    222

    Default

    Registered forum members do not see this ad.

    Quote Originally Posted by Lee Mac View Post
    always there at the right time Lee.

    Cheers !

Similar Threads

  1. Wipeout visibility-help
    By AvisRara in forum AutoCAD 2D Drafting, Object Properties & Interface
    Replies: 4
    Last Post: 9th Jul 2011, 03:00 am
  2. red visibility parameter
    By michaeloureiro in forum AutoCAD Drawing Management & Output
    Replies: 2
    Last Post: 6th Feb 2009, 11:08 am
  3. Filter By Visibility
    By Yoland in forum AutoCAD Drawing Management & Output
    Replies: 8
    Last Post: 31st Jan 2008, 08:39 am
  4. nest visibility parameters inside visibility parameters ??
    By cadmench in forum AutoCAD Beginners' Area
    Replies: 3
    Last Post: 30th Nov 2007, 08:26 pm
  5. STB and CTB visibility
    By Barry Clark in forum AutoCAD Drawing Management & Output
    Replies: 2
    Last Post: 17th Nov 2004, 09:25 pm

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