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.


Registered forum members do not see this ad.
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 agoBut still can't figure it out.
Anyways ill post what I have atm.
If I keep it up coffee won't help me anymore haha!! ill get me bottle of Rhum now.Code:(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:


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.
I would think, that to locate blocks, an insertion point would be critical unless all your blocks have another unique factor I'm overlooking.
"I have only come here seeking knowledge. Things they wouldn't teach me of in college." The Police
Eat brains...gain more knowledge!




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.
then what?...Code:(setq ent1 (entlast))
And another thing I see in commun is the unit factor which i don't know what it is.. it shows 1


Hi, Now that i was able to make my lisp a little better would some1 have a way to make it shorter.
To test ir just use the test2.dwg up aboveCode:(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:
Thanks for the help.
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).![]()
"Potential has a shelf life." - Margaret Atwood


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?
Lee Mac Programming
With Mathematics there is the possibility of perfect rigour, so why settle for less?
Just another Swamper


Bookmarks