+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Junior Member
    Computer Details
    david1-b's Computer Details
    Operating System:
    Windows 7
    Discipline
    Surveying
    david1-b's Discipline Details
    Occupation
    I work on problems and annoyances around the office
    Discipline
    Surveying
    Using
    Civil 3D 2013
    Join Date
    Nov 2012
    Location
    Canada
    Posts
    14

    Default Block hatch fill transparency

    Registered forum members do not see this ad.

    Hello,

    I apologize if my terminology is off as I generally do not work in CAD/LISP.

    I am working on a lisp routine that draws blocks and adds attributes to the blocks (labels). I set the blocks to be a solid hatch and set their colour with (setvar "cecolor" "255").

    After I finished I realized it would be nice to add the ability to draw the blocks without fill if the user wishes. I thought their would be a system variable something like (setvar "transparency" "100") but I can't find anything.

    Does anyone know how to set the transparency of block fill using LISP or how to set the colour to NULL?

    Thanks

  2. #2
    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
    19,368

    Default

    You can use the Visual LISP ActiveX entitytransparency property to set the transparency for an object, e.g.:

    Code:
    (defun c:t50 ( / obj )
        (if
            (and
                (setq obj (car (entsel)))
                (setq obj (vlax-ename->vla-object obj))
                (vlax-property-available-p obj 'entitytransparency t)
                (vlax-write-enabled-p obj)
            )
            (vla-put-entitytransparency obj 50)
        )
        (princ)
    )
    (vl-load-com) (princ)
    Lee Mac ProgrammingTwitterExchange App StoreDropbox (500MB free)

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

  3. #3
    Junior Member
    Computer Details
    david1-b's Computer Details
    Operating System:
    Windows 7
    Discipline
    Surveying
    david1-b's Discipline Details
    Occupation
    I work on problems and annoyances around the office
    Discipline
    Surveying
    Using
    Civil 3D 2013
    Join Date
    Nov 2012
    Location
    Canada
    Posts
    14

    Default

    Great,

    Thank you very much.

  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
    19,368

    Default

    Registered forum members do not see this ad.

    You're very welcome David.
    Lee Mac ProgrammingTwitterExchange App StoreDropbox (500MB free)

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

Similar Threads

  1. Hatch transparency problems
    By Sam Cadder in forum AutoCAD General
    Replies: 6
    Last Post: 27th May 2014, 07:47 am
  2. Adding transparency to Solid Fill areas
    By Daniel C in forum AutoCAD Beginners' Area
    Replies: 9
    Last Post: 28th Aug 2012, 03:11 pm
  3. hatch transparency not working
    By rock1 in forum AutoCAD General
    Replies: 3
    Last Post: 7th Mar 2012, 07:43 am
  4. hatch transparency
    By Fernandobtn in forum AutoCAD General
    Replies: 1
    Last Post: 29th Dec 2010, 06:43 pm
  5. Hatch transparency not working
    By Mark_CV3D in forum Civil 3D & LDD
    Replies: 6
    Last Post: 5th Oct 2010, 10:17 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