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

scale elevation beads

  • Thread starter Thread starter Cristallo
  • Start date Start date

Cristallo

Guest
1725272630397.webpI made a chaplaint: I need to get a rough dtm, starting from polylines of level curves that are all at altitude z 0,00. one by one I brought them to the elevation they should have, except to realize that the starting design was scale 1:2000, while my elevations I put them all to 100.
At this point I should scale all the elevations of the 100/2000 ratio.
I wrote an ad hoc lisp
Code:
(defun c: elevscale ()

(princ "\nselezionare polilinee:")
(setq entit (ssget '(0 . "polyline")))))

(setq number (sslength entit))

(setq scalaxy (getreal "\nscala di disegno lungo x-y: "))
(setq scalaz (getreal "\nscala di disegno lungo z: "))
(setq rapporto (/ scalaz scalaxy))

(setq count 0)

(repeat number

(setq emod (ssname entit count))
(setq elev (asc '38 (enget emod))))
(setq act-elev (cdr (assoc '38))))
(setq new-elev (* act-elev rapporto))
(setq el-nw (cons '38 new-elev)))
(setq emodif (subst el-nw elev))
(setq modi (cdr))
(entupd mod)
(setq count (+ count 1)
);;chiusura repeat
);;chiusura defun
very brutal, but you should do what I want. but I can't make it turn. the entupd call goes wrong.
Is there any saint who tells me where I'm wrong?
 
I don't have time to see the lisp but I suggest you another method.
creates a block of curves. then change the block z scale factor from 1 to 0.05. then explode the block
 
I thought so, but if I don't go out then the balls would explode. in all cases, in a very little elegant way (I would say brutally efficent), I replaced the entroupd with an entmake of the new entity followed by an entdel of the old.
in practice "copio" the pline with the new calculated elevation and eliminate the one from which it derived.
 
hi, I would set "directly" the new elevation with setpropertyvalue:
Code:
(defun c:elevscale ()

(princ "\nselect polylines:")
(setq entities)

(setq number (sslength entit)

(setq scalaxy (getreal "\nscale drawing long x-y: ")
(setq scalaz (getreal)
(setq report (/ scalaz scalaxy)

(setq count 0)

(repeat number)

(setq emod (ssname entit count)
(setq elev (getpropertyvalue emod "elevation")
(setq new-elev (* elev report))
(setpropertyvalue emod "elevation" new-elev)
(setq count (+ count 1))
); repeat closure
); defunct closure
...that you could condense a little:
Code:
(defun c:elevscale ()

(princ "\nselect polylines:")
(setq entities)

(setq scalaxy (getreal "\nscale drawing long x-y: ")
(setq scalaz (getreal)
(setq report (/ scalaz scalaxy)

(repeat (setq count (sslength entit))
(setq emod (ssname entit (setq count (1- count))))
(setq elev (getpropertyvalue emod "elevation")
(setq new-elev (* elev report))
(setpropertyvalue emod "elevation" new-elev)
)
)
 

Forum statistics

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

Members online

No members online now.
Back
Top