Author Topic: Dynamic Blocks and Visual LISP  (Read 12545 times)

0 Members and 1 Guest are viewing this topic.

nivuahc

  • Guest
Dynamic Blocks and Visual LISP
« Reply #15 on: May 14, 2005, 07:32:27 PM »
hehehehe...

Code: [Select]
Command: (getdynprops (vlax-ename->vla-object (car (entsel))))


Select object: (("Visibility" . "Above Counter Duplex"))

nivuahc

  • Guest
Dynamic Blocks and Visual LISP
« Reply #16 on: May 14, 2005, 07:39:07 PM »
My reasons for trying to find this out in the first place...

I see a lot of potential for dynamic blocks in my current position. But I know that, in this case (something like receptacles) my users won't stand with having to insert a receptacle and then change it to the appropriate type.

I want to be able to setup a palette with each variation and, when they select it, it changes to the appropriate setting.

One of the major advantages I see with dynamic blocks, as I believe was the intent, is the elimination of so many blocks that are all similar. When I asked the rep from Autodesk if this was possible, he gave me a blank stare. I was worried that something like that might not be possible.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Dynamic Blocks and Visual LISP
« Reply #17 on: May 14, 2005, 07:48:03 PM »
That's the advantage I see too Chuck ..
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

--> Donate to theSwamp<--

nivuahc

  • Guest
Dynamic Blocks and Visual LISP
« Reply #18 on: May 14, 2005, 11:20:22 PM »
Now that I know how to get that bit of information, I need to figure out how to change it.

And, only three sips in and I'm already in no shape to even try... mwuhahahahahahaha :sot:

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Dynamic Blocks and Visual LISP
« Reply #19 on: May 14, 2005, 11:29:52 PM »
Wild assed Guess :


(SetDynBlockRefPropertyValue DynBlockObject "Visibility"  Who Cares")
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

--> Donate to theSwamp<--

nivuahc

  • Guest
Dynamic Blocks and Visual LISP
« Reply #20 on: May 14, 2005, 11:33:44 PM »
dude... that looks totally sweet.

does it work?

:sot:

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Dynamic Blocks and Visual LISP
« Reply #21 on: May 14, 2005, 11:35:07 PM »
I have absolutely no idea.   MWAHAHA !!
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

--> Donate to theSwamp<--

nivuahc

  • Guest
Dynamic Blocks and Visual LISP
« Reply #22 on: May 14, 2005, 11:37:00 PM »
HA! :D

whdjr

  • Guest
Dynamic Blocks and Visual LISP
« Reply #23 on: August 18, 2005, 10:49:39 AM »
Quote from: nivuahc
My reasons for trying to find this out in the first place...

I see a lot of potential for dynamic blocks in my current position. But I know that, in this case (something like receptacles) my users won't stand with having to insert a receptacle and then change it to the appropriate type.

I want to be able to setup a palette with each variation and, when they select it, it changes to the appropriate setting.

One of the major advantages I see with dynamic blocks, as I believe was the intent, is the elimination of so many blocks that are all similar. When I asked the rep from Autodesk if this was possible, he gave me a blank stare. I was worried that something like that might not be possible.


Chuck,

It's much simpler than you think man.  Once you get your block the way you want it and add it to a pallette then right click on the icon in the tool pallette and select properties.  You have access to all your modifications right there.  All you need to do is make 3 or 4 copies of the same tool in the pallette and then change the properties per icon to show the desired visibility state. Cool?  yeh!


Eloquintet

  • Gator
  • Posts: 3206
Dynamic Blocks and Visual LISP
« Reply #24 on: August 18, 2005, 03:11:54 PM »
that's sweet will, wasnt aware of that ability thanks
Dan

AutoCAD Architecture 2015

CADwoman

  • Guest
Re: Dynamic Blocks and Visual LISP
« Reply #25 on: June 19, 2006, 09:46:48 AM »
Hi, is there a way to some how link the visibility state of a dblock to the sheet set manager? So the concept is to come up some type of reactor to link the visibility state with the appropriate sheet set parameter. So for example, when the sheet set parameter changes, the visibility state of the associated dblock would change accordingly. Does this make any sense to you? thanks

Oh that's sweeeeet...

Code: [Select]
Command: (getdynprops (vlax-ename->vla-object (car (entsel))))

Select object: (("Visibility" . "Isolated Ground Duplex"))

cadplayer

  • Bull Frog
  • Posts: 385
  • Autocad Civil3d, OpenDCL.Runtime, LISP, .NET (C#)
Re: Dynamic Blocks and Visual LISP
« Reply #26 on: June 12, 2013, 06:47:25 AM »
Hi!

I know thats a old thread, but my only question is:
If I can ask which coordinates have the flag position in this block

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: Dynamic Blocks and Visual LISP
« Reply #27 on: June 12, 2013, 07:24:05 AM »
First, that block has several visibility states. and only in some are the polar parameters available.

Next, each polar parameter has a distance and an angle parameter, so the "coordinates" are formed by 2 parameters into a polar coordinate.
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.

cadplayer

  • Bull Frog
  • Posts: 385
  • Autocad Civil3d, OpenDCL.Runtime, LISP, .NET (C#)
Re: Dynamic Blocks and Visual LISP
« Reply #28 on: June 12, 2013, 07:52:30 AM »
Yes I know that block have 3 dynamic visibility states, I try to do it with one so when I paste block via command I turn on "visibility1" parameter with name "1 Leader ON". The next step is so you said I must calculate from "1 Leader ON" paramter polarCoordinates, I donīt know how.

Code: [Select]
;; From: "Tony Tanzillo"
;; Newsgroups: autodesk.autocad.customization
;; Sent: Friday, May 13, 2005 6:37 AM
;; Subject: Re: DynamicBlock method

;; Get a single dynamic block property object by name

(defun dyGet (DynBlockRef Name)
  (vl-some
    (function (lambda (property)
        (if (eq (vlax-get-property property 'PropertyName) Name)
            property
            )
          )
        )
   
      (vlax-safearray->list
        (vlax-variant-value
            (vla-getDynamicBlockProperties DynBlockRef)
        )
      )
  )
)

;; Set the vlaue of a single dynamic block property object by name

(defun dySet (DynBlockRef Name NewValue / Property)
  (if (setq property (dyGet DynBlockref Name))
      (progn
        (vlax-put-property property 'Value NewValue)
        (vlax-release-object Property)
      )
  )
)

; Test command

(defun c:test ()
    (command "_insert" "knr" (setq pt (getpoint "\nPosition No.!")) (getvar "DIMSCALE") (getvar "DIMSCALE") 0
                                         "1"
                                         "NAME"
                                         )
                                (dySet (vlax-ename->vla-object (entlast)) "Visibility1" "1 Leader ON")
                                )




cadplayer

  • Bull Frog
  • Posts: 385
  • Autocad Civil3d, OpenDCL.Runtime, LISP, .NET (C#)
Re: Dynamic Blocks and Visual LISP
« Reply #29 on: June 12, 2013, 08:19:43 AM »
Can you help me how I can manipulate angle and distance faktor in visibility state "1 Leader ON" ?!