• This forum is the machine-generated translation of www.cad3d.it/forum1 - the Italian design community. Several terms are not translated correctly.

quote altimetriche

Martina Webber

Guest
Good evening to all,
I am martin a technical designer and use autocad 2017, I looked everywhere and I did not find a solution to my problem (it seems like a trivial thing but I cannot understand where to put my hands) I explain.
I have a lisp that fixing a reference point manages to update all selected blocks called "quota_altimetrica". There are no problems until I change the visibility of the block (to display the symbol of the groundwater), if I try to update the quota you do not select, as if the block was another.
the only way to solve the situation is to restore the block, update the quota and then select the desired visibility, but it is not practical.

I don't know where to slam my head, I thought I'd make two different blocks and two different lisp, but they're not fighting, i.e. I loaded one or load the other, not using them in parallel.

I attach a dwg file with the block in question and the lisp (unfortunately it is in German).View attachment Quote.dwg, View attachment Quota altimetrica.lspn.b.: the attribute in the two visibility is the same, the only difference is the presence of the lines under the quota.
 
Bye.
If you agree to a program without blockages I offer mine.
you must store it in file called quotav.lsp
insert it into a search directory (e.g. autocad 2017-support)
part with the command (load "quotav") try it.
If that doesn't suffice, I'll tell you a site where I saw texitaliano64 that made available a similar program, I think it's done with blocks.
Hi.
http://bar-ingegneria.forumfree.it/?t=74986967#newpost;quotav.lsp calculates and inserts vertical quotas
;autocad 2012 25-11-2011
(prompt "\n ")
(setq n (getvar "useri1"))
(cond)
((= n 0); unit cm
(setq um "cm" dec 0)
)
((= n 1); unit mm
(setq um "mm" dec 0)
)
((= n 2); unit m
(setq um "m" dec 2)
)
);

(if ht nil (setq ht 2) ; text height tax
(if qb nil (setq qb 0) ; basic quota tax
(setq sc)
pb (getpoint "\npoint quota base : ")
a (strcat "\nimmetti valore quota base <" (rtos qb) "> :")
qb1 (getreal a)
a (strcat "\nimmetti altezza testo ht = mm <" (rtos ht) "> :")
ht1 (getreal a)
)
(if (/= ht1 nil) (setq ht ht1)); text height tax
(if (/= qb1 nil) (setq qb qb1)); basic quota tax
(setq dl (* 0.125 ht sc)
(command "_setvar" "textsize" (* ht (getvar "dimscale") 0.1)
(command "_color" 3)
(command "_linetype" "_s" "continuous"")


(while)
(setq os (getvar "osmode")
(setq p (getpoint "\nimmetti punto quota : ")
(- (cadr p) (cadr pb))
dh (+ dh qb)
a (rtos dh 2 dec)
)
(if (= dh 0) (setq a (strcat "%%p" a)))
(if (> dh 0) (setq a (strcat "+" a)))
(setq p1 (- (car p) dl) (+))
p1 (list (- (car p) dl) (+ (cadr p) dl))
p2 (list (car p) (+ (cadr p) dl))
p3 (list (+ (car p) dl) (+ (cadr p) dl))
)
(command "_osmode" 0)
(command "_pline" p3 p1 p3 ")
(command "_solid" p2 p3 """)
(command "_text" "_c" (list (car p) (+ (cadr p) (* 0.2 ht sc)))" 0 a)
(command "_osmode" os)
);
 
Good morning.
Thank you. [MENTION=22561]betoniera[/MENTION] for the straight, I have already tried this lisp and the convenience of the block and the lisp in my possession is that the odds can be upgraded even at a later time, and if I have to move them or change the type of quota should be faster, it is for a couple of months that I work there, but the lisp did not write it and I can not put it hand given my ignorance of the programming, I managed to understand that what is affecting on the selection of the block
(sget ...but I can't understand how to insert in addition to the "quota_altimetrica" block the possibility of choosing a second element (an exemplary block for the groundwater), must be
(Said...when I could solve the problem I would make it available to everyone (after having translated the indications from German to Italian, are of the high adige for this the indications are in German)
 
the problem, according to me martin, is that when you change the visibility of a dynamic block, autocad the "rename" in *u<numero> (as was an anonymous block) and therefore the lisp no longer sees it</numero>
 
thanks tristan, I imagined something like this would happen, so it would be better to create two blocks but I can't understand how to write in the lisp than to take "quote_altimetriche" you can also select "quote_altimetriche_falda". until now I understand that this must be specified in the string
(setq lists (ssget '(0 . "insert") (2 . "quota_altimetrica"))))
(setq anzahl (sslength lists)
(setq nr 0)
(while (< nr anzahl) (setq element (ssname liste nr))
but I don't understand how to put
(ssaddand especially where

if you prefer I translate the lisp in Italian, it is not a problem
 
the problem arises from the ssget command that seeks the block with the name "quota_altimetrica", the dynamic blocks are represented by name *u.. but through the function (vlax-get-property (vlax-ename->vla-object n) 'effectivename) you can have the original name.
in the file lisp I added the function that operates this operation, you find it at the bottom of the file, added the code that creates the list by filtering all the blocks with the actual name.

Hi.
 

Attachments

mitichissimo rpor66, you solved my problem:finger::finger::4406:

Do you think it's useful to make it available to everyone on a separate discussion or can it be okay like this? I would have translated it into Italian and with the addition of the correction I could make available the complete block with the lisp in Italian.
 
Here it is, now I translated the lisp with the indications in Italian (I apologize for the inconvenience).
attach together with the lisp in Italian also the dwg file that contains the complete block (besides the layer there is the type of quota for the existing according to the current legislation).

Thanks again immensely for the help and I hope that next time I will not have to ask for help but I will charge something useful to all.. .
 

Attachments

Forum statistics

Threads
44,997
Messages
339,767
Members
4
Latest member
ibt

Members online

No members online now.
Back
Top