+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    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,707

    Question Adding Block Definitions in Visual LISP

    Registered forum members do not see this ad.

    I realise this can be achieved without the use of Visual LISP using entmake, however, I am intrigued as to the Visual LISP alternative, if indeed, there is one.

    I have read the help article on "vla-add", but this seems to only require a basepoint and Block name String. So how does one add the necessary objects to the block definition?

    Thanks,

    Lee
    Lee Mac Programming

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

    Just another Swamper

  2. #2
    Super Member fixo's Avatar
    Computer Details
    fixo's Computer Details
    Operating System:
    Windows 7
    Motherboard:
    E7500
    CPU:
    Intel(R)Core(TM)2 DUO CPU 2.93HGz
    RAM:
    4098 Gb
    Graphics:
    1024 Gb
    Using
    AutoCAD 2009
    Join Date
    Jul 2005
    Location
    Pietari, Venäjä
    Posts
    1,586

    Default

    Then you need to add to this block definitions all
    of the entities you want
    The same way as for vla-add-modelspace but in this case
    you need to write:

    vla-addline <myblock definition> etc etc
    vla-addattribute <myblock definition> etc etc

    Sorry for my bad explanation, hope you're understand

    ~'J'~
    The soul is healed by being with children. - Fyodor Dostoyevsky, novelist (1821-1881)

  3. #3
    Senior Member wizman's Avatar
    Using
    AutoCAD 2009
    Join Date
    Nov 2007
    Location
    Abu Dhabi / Philippines
    Posts
    408

    Default

    just like fixo is saying, think of the block as another space:

    Code:
    	(setq myblockspace
    	       (vla-add
    		 (vla-get-Blocks
    		   (vla-get-ActiveDocument
    		     (vlax-get-acad-object)))
    			(vlax-3d-point '(0 0 0))
    			"testblock"
    		))
            (vla-addline myblockspace (vlax-3d-point '(0 0 0)) (vlax-3d-point '(0 1 0)))

  4. #4
    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,707

    Default

    Quote Originally Posted by fixo View Post
    Then you need to add to this block definitions all
    of the entities you want
    The same way as for vla-add-modelspace but in this case
    you need to write:

    vla-addline <myblock definition> etc etc
    vla-addattribute <myblock definition> etc etc

    Sorry for my bad explanation, hope you're understand

    ~'J'~
    Yes, I understand perfectly, thanks as always Fixo
    Lee Mac Programming

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

    Just another Swamper

  5. #5
    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,707

    Default

    Registered forum members do not see this ad.

    Thanks Wizman for the example - much appreciated
    Lee Mac Programming

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

    Just another Swamper

Similar Threads

  1. Visual Lisp Reference Charts
    By The Buzzard in forum AutoLISP, Visual LISP & DCL
    Replies: 18
    Last Post: 15th Apr 2013, 07:21 am
  2. using VBA Forms with visual lisp
    By erdurmaz in forum AutoLISP, Visual LISP & DCL
    Replies: 2
    Last Post: 30th Dec 2008, 09:16 pm
  3. Block Attribute Definitions
    By skipsophrenic in forum AutoCAD 2D Drafting, Object Properties & Interface
    Replies: 3
    Last Post: 3rd Dec 2008, 07:21 am
  4. Viewing 3D Block Definitions in AutoCAD 2008
    By AutoCAD Insider in forum AutoCAD RSS Feeds
    Replies: 0
    Last Post: 23rd Mar 2007, 08:12 pm
  5. Visual Lisp Text
    By nauggie in forum AutoLISP, Visual LISP & DCL
    Replies: 3
    Last Post: 5th Oct 2006, 12:28 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