CadFrank Posted April 5, 2012 Author Share Posted April 5, 2012 Haha!! luck.. I can't get lucky at a card game not sure life is any different haha!! I'm so pessimist.. if that how we write it lol Quote Link to comment Share on other sites More sharing options...
CadFrank Posted April 5, 2012 Author Share Posted April 5, 2012 Arrrg i can change the dynamic block properties when i insert it. How do i select a block that already in drawing and modify it to the write visibility state. don't mind my comment i'm only going crazy hehe!! Quote Link to comment Share on other sites More sharing options...
ReMark Posted April 5, 2012 Share Posted April 5, 2012 Use the BEDIT (Block Edit) command. Quote Link to comment Share on other sites More sharing options...
CadFrank Posted April 5, 2012 Author Share Posted April 5, 2012 Ill look it up thanks . Quote Link to comment Share on other sites More sharing options...
BlackBox Posted April 5, 2012 Share Posted April 5, 2012 why am i not getting any answers to my post?? Geez... Is everyone in Quebec so impatient...? LoL I didn't mean to leave you stranded, dude - I just had a lot of work to complete prior to my taking a short vacation today and tomorrow. :wink: Arrrg i can change the dynamic block properties when i insert it. How do i select a block that already in drawing and modify it to the write visibility state. don't mind my comment i'm only going crazy hehe!! ... My how quickly you forget the help you were given (9 months ago), perhaps you should re-read your multi-page thread, and attempt to revise the plethora of code provided you then to work with your dynamic block's visibility states. It's a tricky one, I know, but I believe that you've been given all of the framework code needed for you to go from counting dynamic blocks, to manipulating. If you get stuck, post back the code you've updated. Quote Link to comment Share on other sites More sharing options...
ReMark Posted April 5, 2012 Share Posted April 5, 2012 This is a re-hash of a previous post on the same subject from NINE months ago? I thought it was some kind of emergency! Forgettaboutit. Quote Link to comment Share on other sites More sharing options...
BlackBox Posted April 5, 2012 Share Posted April 5, 2012 Not exactly... Being fair, this is a logical step from the previous topic... The former being that the OP desired to count dynamic blocks of various Visibility States, to the latter where the OP is wanting to manipulate the Visibility State of a (set of) selected dynamic block(s). Each deserving of a separate thread given the task. It is just unfortunate that the amount of time, information, and code previously offered has yet to help to minimize the difficulty of the current task. Hopefully the reminder will allow the OP the opportunity for that 'aha' moment... I can't tell you how many times, I've gone back and re-read old threads and only months later actually understood the help I was given. Thankfully Lee, and Alan (and others) are so patient! Quote Link to comment Share on other sites More sharing options...
CadFrank Posted April 5, 2012 Author Share Posted April 5, 2012 Geez... Is everyone in Quebec so impatient...? LoL Did you meet other people from québec in this forum that were impatient lol... Well like I've been going round and round on this to try to do what i want... Now that i've had my course on autolisp I have a better understanding of the language but it give me headhacks... (well sorry about my bad english i tend to forget how to write some words lol.. ... My how quickly you forget the help you were given (9 months ago), perhaps you should re-read your multi-page thread, and attempt to revise the plethora of code provided you then to work with your dynamic block's visibility states. It's a tricky one, I know, but I believe that you've been given all of the framework code needed for you to go from counting dynamic blocks, to manipulating. But refering to my problem here I am not trying to count them now.. mostly trying to make some changes without having to manipulates the blocks... There for, I will take you're advice and look up the 9 month old thread. Might be of some help. So on this i wish you a good vacation hehe!! oh and I also am on vacation. So prepare on thuesday to be bombarded of impatient question Cheers & Beers. Quote Link to comment Share on other sites More sharing options...
BlackBox Posted April 6, 2012 Share Posted April 6, 2012 Too funny - you're spending your vacation working on this aspect of LISP, and I've been home coding Visual LISP expansion functions that allow Visual Lisp to interact with the System.IO.* Classes (.NET API) via LispFunction Methods. LoL Let us know how it goes, again, different tasks I know but hopefully the previous thread will make more sense now that you've completed your course. Cheers & beers, indeed. Quote Link to comment Share on other sites More sharing options...
CadFrank Posted April 6, 2012 Author Share Posted April 6, 2012 HEHE !! sadly the course had nothing to do with vlisp what so ever.. it was merely an introduction!! But still i get the picture of the language. So, I guess ill have to hit the wall a few times before i get somewhere. Quote Link to comment Share on other sites More sharing options...
CadFrank Posted April 13, 2012 Author Share Posted April 13, 2012 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. (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. test2.dwg Quote Link to comment Share on other sites More sharing options...
CadFrank Posted April 13, 2012 Author Share Posted April 13, 2012 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. Quote Link to comment Share on other sites More sharing options...
ReMark Posted April 13, 2012 Share Posted April 13, 2012 I would think, that to locate blocks, an insertion point would be critical unless all your blocks have another unique factor I'm overlooking. Quote Link to comment Share on other sites More sharing options...
CadFrank Posted April 13, 2012 Author Share Posted April 13, 2012 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 Quote Link to comment Share on other sites More sharing options...
CadFrank Posted April 13, 2012 Author Share Posted April 13, 2012 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. (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 Quote Link to comment Share on other sites More sharing options...
CadFrank Posted April 16, 2012 Author Share Posted April 16, 2012 Hi, Now that i was able to make my lisp a little better would some1 have a way to make it shorter. (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. Quote Link to comment Share on other sites More sharing options...
BlackBox Posted April 16, 2012 Share Posted April 16, 2012 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). Quote Link to comment Share on other sites More sharing options...
CadFrank Posted April 17, 2012 Author Share Posted April 17, 2012 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? Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted April 17, 2012 Share Posted April 17, 2012 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 Quote Link to comment Share on other sites More sharing options...
CadFrank Posted April 17, 2012 Author Share Posted April 17, 2012 http://lee-mac.com/localising.html always there at the right time Lee. Cheers ! Quote Link to comment Share on other sites More sharing options...
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.