Um programa para o civil 3d, e usando algumas das funções da TLB dele!! este programa cria profileviews dos alinhamentos selecionados, util quando se está criando "corridors" com varios alinhamentos auxiliares numa interseção, o como foi um caso em que estou trabalhando, uma rua com 4 cruzamentos, cada um com 4 alinhamentos auxiliares, para criar as concordâncias... ou seja, é muita coisa pra criar profileview um a um, ainda mais que serão temporário..
mais...
tem uma outra bem parecida que serve para criar os "profile from surface" para estes alinhamentos, outra hora eu posto;cria profileviews de alinhamentos selecionados
(defun c:pv2allalign (/ ss ent vla pt d llayer lstyle lbandset dcl)
(tbn:error-init nil)
(if (setq ss (ssget '((0 . "AECC_ALIGNMENT"))))
(if (setq pt (getpoint "\nIndique a posição do primeiro Profile View"))
(progn
(setq lstyle (prof2allalign_getnames (cvlp-get-ProfileViewStyles aec-adoc))
lbandset (prof2allalign_getnames (cvlp-get-ProfileViewBandStyleSets aec-adoc))
llayer (prof2allalign_getnames (vla-get-layers aec-adoc))
llayer (vl-remove nil (mapcar '(lambda (x) (if (not (vl-string-search "|" x)) x)) llayer))
dcl (load_dialog "f:/autocad/tbn2/lisps/pv2allalign.dcl"))
(new_dialog "pv2allalign" dcl)
(multi_set_action_tile
'("style" "layer" "bandset" "prefixo" "separa")
(list (list pv2allalign:style lstyle "style")
(list pv2allalign:layer llayer "layer")
(list pv2allalign:bandset lbandset "bandset")
pv2allalign:prefixo
pv2allalign:separa)
"(pv2allalign_actions $key $value)")
(pv2allalign_mode_tiles)
(if (= 1 (start_dialog))
(repeat (sslength ss)
(setq ent (ssname ss 0)
vla (vlax-ename->vla-object ent)
prof (cvlm-add
(cvlp-get-profileviews vla)
(strcat (if pv2allalign:prefixo pv2allalign:prefixo "") (cvlp-get-name vla))
pv2allalign:layer
(vlax-3d-point pt)
pv2allalign:style
pv2allalign:bandset)
d (get-bounding-box prof)
pt (list (+ (- (caadr d) (caar d)) pv2allalign:separa (car pt))
(cadr pt)))
(ssdel ent ss)))
(unload_dialog dcl)
)))
(tbn:error-restore))
(defun pv2allalign_actions (key val)
(if (= key "prefixo")
(setq pv2allalign:prefixo val)
(set (read (strcat "pv2allalign:" key))
(nth (atoi val) (eval (read (strcat "l" key))))))
(pv2allalign_mode_tiles))
(defun pv2allalign_actions (key val)
(if (= key "prefixo")
(setq pv2allalign:prefixo val)
(if (= key "separa")
(setq pv2allalign:separa (atof val))
(set (read (strcat "pv2allalign:" key))
(nth (atoi val) (eval (read (strcat "l" key)))))))
(pv2allalign_mode_tiles))
(defun pv2allalign_mode_tiles nil
(mode_tile "accept" (if (and pv2allalign:layer
pv2allalign:style
pv2allalign:bandset
pv2allalign:separa) 0 1)))
;variaveis globais
(setq
pv2allalign:layer "PERFIL"
pv2allalign:style "PARALLELA"
pv2allalign "Standard"
pv2allalign:prefixo "PV-"
pv2allalign:separa 20)
Link(s) da(s) subrotina(s) usada(s):
tbn:error-init, aec-adoc, multi_set_action_tile, get-bounding-box, tbn:error-restore
(defun c:pv2allalign (/ ss ent vla pt d llayer lstyle lbandset dcl)
(tbn:error-init nil)
(if (setq ss (ssget '((0 . "AECC_ALIGNMENT"))))
(if (setq pt (getpoint "\nIndique a posição do primeiro Profile View"))
(progn
(setq lstyle (prof2allalign_getnames (cvlp-get-ProfileViewStyles aec-adoc))
lbandset (prof2allalign_getnames (cvlp-get-ProfileViewBandStyleSets aec-adoc))
llayer (prof2allalign_getnames (vla-get-layers aec-adoc))
llayer (vl-remove nil (mapcar '(lambda (x) (if (not (vl-string-search "|" x)) x)) llayer))
dcl (load_dialog "f:/autocad/tbn2/lisps/pv2allalign.dcl"))
(new_dialog "pv2allalign" dcl)
(multi_set_action_tile
'("style" "layer" "bandset" "prefixo" "separa")
(list (list pv2allalign:style lstyle "style")
(list pv2allalign:layer llayer "layer")
(list pv2allalign:bandset lbandset "bandset")
pv2allalign:prefixo
pv2allalign:separa)
"(pv2allalign_actions $key $value)")
(pv2allalign_mode_tiles)
(if (= 1 (start_dialog))
(repeat (sslength ss)
(setq ent (ssname ss 0)
vla (vlax-ename->vla-object ent)
prof (cvlm-add
(cvlp-get-profileviews vla)
(strcat (if pv2allalign:prefixo pv2allalign:prefixo "") (cvlp-get-name vla))
pv2allalign:layer
(vlax-3d-point pt)
pv2allalign:style
pv2allalign:bandset)
d (get-bounding-box prof)
pt (list (+ (- (caadr d) (caar d)) pv2allalign:separa (car pt))
(cadr pt)))
(ssdel ent ss)))
(unload_dialog dcl)
)))
(tbn:error-restore))
(defun pv2allalign_actions (key val)
(if (= key "prefixo")
(setq pv2allalign:prefixo val)
(set (read (strcat "pv2allalign:" key))
(nth (atoi val) (eval (read (strcat "l" key))))))
(pv2allalign_mode_tiles))
(defun pv2allalign_actions (key val)
(if (= key "prefixo")
(setq pv2allalign:prefixo val)
(if (= key "separa")
(setq pv2allalign:separa (atof val))
(set (read (strcat "pv2allalign:" key))
(nth (atoi val) (eval (read (strcat "l" key)))))))
(pv2allalign_mode_tiles))
(defun pv2allalign_mode_tiles nil
(mode_tile "accept" (if (and pv2allalign:layer
pv2allalign:style
pv2allalign:bandset
pv2allalign:separa) 0 1)))
;variaveis globais
(setq
pv2allalign:layer "PERFIL"
pv2allalign:style "PARALLELA"
pv2allalign "Standard"
pv2allalign:prefixo "PV-"
pv2allalign:separa 20)
Link(s) da(s) subrotina(s) usada(s):
tbn:error-init, aec-adoc, multi_set_action_tile, get-bounding-box, tbn:error-restore