CadFrank Posted April 4, 2012 Posted April 4, 2012 Hi, Im Looking to change a lookup and a visibily state in a dynamic block with a lisp routine This routine will change a certain number of tower and a hook radius. So I need to give a radius and a height(number of tower) To give a bigger picture it is a program for tower cranes. Thank for all the help in advance. If you need more information don't hesitate to ask Cheers & Beers Quote
BlackBox Posted April 4, 2012 Posted April 4, 2012 Have you looked into the Allowed Values of the DynamicBlockProperties Object for the available Visibility State(s)? Quote
CadFrank Posted April 4, 2012 Author Posted April 4, 2012 Well I have found a way to get the Visibility State.. but the lookup i can't find it. Is there a way to select block already in the drawing them put them in entlast without selecting objets. (setq Boom (entlast)) (setq Boom (vlax-ename->vla-objet Boom)) (vlax-dump-object Boom) (setq dbp (vla-getdynamicblockproperties Boom)) (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) Test.dwg Quote
CadFrank Posted April 4, 2012 Author Posted April 4, 2012 Hi I don,t want to pressure anyone but is it possible to be pointed in the right direction so i can continu my routine. Thank Quote
CadFrank Posted April 4, 2012 Author Posted April 4, 2012 (edited) test2.dwgOk So ill give more information here! Ill give another autocad drawing with it. I need to be able to change all those 3 dynamic block with their visibility states. If you select all 3 in the drawing you can change the value of then in properties/ custom/visibility1 in this code here : (setq fleche '("LC CHARGE 290" "LC B-T 290" "LC C-P 290")) (initget 1 "74m 70m 64m 60m 54m 50m 44m 40m") (setq b-radius(getkword "\n Donner le rayon de la flèche : ")) (vl-load-com) (setq adoc (vla-get-activedocument (vlax-get-acad-object))) (vlax-for fleche(vla-get-blocks adoc)) ;(initget 1 "170 210 290 550") ;(setq tower-serie(getkword "\nDonner le modele de la grue : ")) (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) i can change the value of the visibility but i can seem get it to select the blocks i want. Edited April 13, 2012 by CadFrank Quote
CadFrank Posted April 5, 2012 Author Posted April 5, 2012 Hi, i really need some help here ive been working on this since 3 days can't seem to get anywhere please help me out i'm about to lose my head! Quote
CadFrank Posted April 5, 2012 Author Posted April 5, 2012 why am i not getting any answers to my post?? Quote
ReMark Posted April 5, 2012 Posted April 5, 2012 Which post are you referring to? Could be no one has an answer. Or it could be the question is not understood but no one has bothered to either say so or to ask for follow-up information. Could be things are a bit slow; everyone is kind of busy perhaps. We are, after all, only volunteers and not paid staff. I'm sure it is not intentional. These things do happen though. Quote
CadFrank Posted April 5, 2012 Author Posted April 5, 2012 Its the third Post I'm sorry i must sound kinda mad.. lol I just been trying to solve this routine for so long ... Don't know where to go anymore. Quote
ReMark Posted April 5, 2012 Posted April 5, 2012 Is this the one you are referring to? Hi, Im Looking to change a lookup and a visibily state in a dynamic block with a lisp routine. The low number of responses may have something to do with the fact that 1) it involves a dynamic block and 2) the fact you are looking for help with a lisp routine. That reduces the number of people who will look at the question and attempt to help as they have to be knowledgeable in both areas. Quote
CadFrank Posted April 5, 2012 Author Posted April 5, 2012 Yes this is the right post! Ok so what should I do to get an answer? I also gave alot of information I think regarding what i want to achieve. Quote
CadFrank Posted April 5, 2012 Author Posted April 5, 2012 Donner le rayon de la flèche : 50m ; IAcadBlockReference2: AutoCAD Block Reference Interface ; Property values: ; Application (RO) = #<VLA-OBJECT IAcadApplication 0000000140437198> ; Document (RO) = #<VLA-OBJECT IAcadDocument 00000000342d2f10> ; EffectiveName (RO) = "LC B-T 290" ; EntityTransparency = "ByLayer" ; Handle (RO) = "21E9" ; HasAttributes (RO) = 0 ; HasExtensionDictionary (RO) = -1 ; Hyperlinks (RO) = #<VLA-OBJECT IAcadHyperlinks 000000002d7e7be8> ; InsertionPoint = (21680.5 22407.2 0.0) ; InsUnits (RO) = "Millimeters" ; InsUnitsFactor (RO) = 1.0 ; IsDynamicBlock (RO) = -1 ; Layer = "0" ; Linetype = "ByLayer" ; LinetypeScale = 1.0 ; Lineweight = -1 ; Material = "ByLayer" ; Name = "*U295" ; Normal = (0.0 0.0 1.0) ; ObjectID (RO) = 42 ; ObjectID32 (RO) = 42 ; ObjectName (RO) = "AcDbBlockReference" ; OwnerID (RO) = 43 ; OwnerID32 (RO) = 43 ; PlotStyleName = "ByLayer" ; Rotation = 0.0 ; TrueColor = #<VLA-OBJECT IAcadAcCmColor 000000002d7e7e80> ; Visible = -1 ; XEffectiveScaleFactor = 1.0 ; XScaleFactor = 1.0 ; YEffectiveScaleFactor = 1.0 ; YScaleFactor = 1.0 ; ZEffectiveScaleFactor = 1.0 ; ZScaleFactor = 1.0 ; IAcadDynamicBlockReferenceProperty: AutoCAD Dynamic Block Property Interface ; Property values: ; AllowedValues (RO) = ("74m" "70m" "64m" "60m" "54m" "50m" ... ) ; Description (RO) = "" ; PropertyName (RO) = "Visibility1" ; ReadOnly (RO) = 0 ; Show (RO) = -1 ; UnitsType (RO) = 0 ; Value = "74m" nil this is what it says when i run the routine if you refer to the autocad drawing and the routine here : test2.dwg (defun c:Grue () (initget 1 "74m 70m 64m 60m 54m 50m 44m 40m") (setq B-Radius(getkword "\n Donner le rayon de la flèche : ")) (vl-load-com) (setq adoc (vla-get-activedocument (vlax-get-acad-object))) (setq fleche(vla-item (vla-get-blocks adoc) "LC CHARGE 290")) ;(initget 1 "170 210 290 550") ;(setq tower-serie(getkword "\nDonner le modele de la grue : ")) (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) );defun c: Quote
ReMark Posted April 5, 2012 Posted April 5, 2012 You can... 1) Wait and see if there is any further response. 2) Go to the AutoDesk > AutoCAD > Customization/Programming forum and post your question there. 3) Post your question at "The Swamp" where I tend to think more writers of lisp routines tend to congregate. 4) Have an "Eureka!" moment after consuming ten cups of coffee. 5) Pray for divine intervention. Quote
SLW210 Posted April 5, 2012 Posted April 5, 2012 I merged your threads. Just be patient. It has only been 24hrs since you first posted. In due time help may arrive. Quote
CadFrank Posted April 5, 2012 Author Posted April 5, 2012 You can... 1) Wait and see if there is any further response. 2) Go to the AutoDesk > AutoCAD > Customization/Programming forum and post your question there. 3) Post your question at "The Swamp" where I tend to think more writers of lisp routines tend to congregate. 4) Have an "Eureka!" moment after consuming ten cups of coffee. 5) Pray for divine intervention. Ok so I did 3,4,5 but now i'm out of coffee!!! Quote
ReMark Posted April 5, 2012 Posted April 5, 2012 On any given day there could be several questions that get no response what-so-ever. Stuff happens. What can I say? There is no guarantee that someone will answer a question. That's one drawback of a free help site. Now, if people wanted to start paying a yearly subscription.......... Quote
CadFrank Posted April 5, 2012 Author Posted April 5, 2012 Well what do you mean by a yearly subscription Quote
ReMark Posted April 5, 2012 Posted April 5, 2012 Well what do you mean by a yearly subscription Fact: There is no yearly subscription to CADTutor. It is a FREE AutoCAD help site. I meant that if people paid for a service, like a subscription, then there could be a legitimate feeling that they should get something in return. Quote
CadFrank Posted April 5, 2012 Author Posted April 5, 2012 True.. Well ill wait till something pops!!! Quote
ReMark Posted April 5, 2012 Posted April 5, 2012 Life is a mystery. Sometimes we get answers, sometimes we don't. Maybe you'll have some better luck today. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.