Ajuda Rotina Autolisp

Moderador: Moderadores

SALDANHA
Novato
Novato
Mensagens: 2
Registrado em: Seg 13 Abr 2020 8:40:46 pm

Ajuda Rotina Autolisp

Mensagem por SALDANHA »

Boa noite meus caros, estou pela primeira vez neste blog, não sou programador, estou arriscando alguns comando no autocad. Estou com uma rotina que antigamente lá em 2005 ela funcionava muito bem, ela cotava as linhas automaticamente assim que selecionava as mesmas e colocava a distância do vão e a informação do cabo que inicialmente era solicitada. Ela usa para isso blocos existente no autocad, porém ela não está colocando o valor do vão e sim somente ("xx.m"(, e a informação inicial que escrevo após a solicitação também não, mas esta informação não é mais necessária hoje, será que alguém pode me ajudar a corrigir está rotina?


(defun c:RED ()
(setq PO "n")

(SETQ PO (getstring "\nDeseja postes (s/n): ""n"))
(command "LAYER" "N" "CABO" "")
(setq meio 0.0)
(setq dist 0.0)
(setq sdt2 0.0)
(command "osnap" "none")
(setq ss (ssget))
(setq n (sslength ss))
(setq i 0)
(while (< i n)
(setq en (ssname ss i)
pnt1 (cdr (assoc 10 (entget en)))
pnt3 (cdr (assoc 11 (entget en)))
)
(setq
X1 (car pnt1)
Y1 (cadr pnt1)
X3 (car pnt3)
Y3 (cadr pnt3)
Xm (/ (+ X3 X1) 2)
Ym (/ (+ Y3 Y1) 2)
X0 (+ Xm 0.000000001)
Y0 (+ Ym 0.000000001)
dt1 (distance pnt1 pnt3)
meio (/ dt1 2)
txt (RTOS dt1 2 2)
)
(progn

(cond
((and (< x0 x3) (< Y0 Y3))
(setq pnt (list x0 y3)
pnti pnt1
pntf pnt3
)
)
((and (< x0 x3) (> Y0 Y3))
(setq pnt (list x3 y0)
pnti pnt1
pntf pnt3
)
)
((and (> x0 x3) (< Y0 Y3))
(setq pnt (list x0 y3)
pnti pnt3
pntf pnt1
)
)
((and (> x0 x3) (> Y0 Y3))
(setq pnt (list x3 y0)
pnti pnt3
pntf pnt1
)
)
(t nil)
)
)
(setq dist (strcat (rtos dt1 2 2) " "))
(SETQ M1 (/ (- Y3 Y0) (- X3 X0)))
(SETQ TETA (angtos (atan (/ -1 M1)) 0 6))
(progn
(command "ucs" "n" "3" pnti pntf pnt)
(command "_insert" ;;;;"PODE CLOCAR QUALQUER NOME DE BLOCO EXISTENTE NO AUTOCAD QUE ELA IRA FUNCIONAR";;;
(list meio 0) "" "" "" cabo dist) ;;;;ACHO QUE É ALGUMA COISA POR AQUI QUE NÃO ESTÁ FUNCIONANDO;;;;
(command "_CHANGE" "_L" "" "_P" "_LA" "CAB_P" "" "")

(IF (OR (EQUAL PO "s")
(EQUAL PO "S")
)
(PROGN
(command "_insert" ;;;;"PODE CLOCAR QUALQUER NOME DE BLOCO EXISTENTE NO AUTOCAD QUE ELA IRA FUNCIONAR";;;; (list DT1 0) "" "" "" "" )
(command "_CHANGE" "_L" "" "_P" "_LA" "PTE_P" "" "")
)
)
(command "ucs" "w")
)
(SETQ i (1+ i))
)

)

PARA ELA FUNCIONAR É SÓ COLOCAR O NOME NO BLOCO AQUI:
(command "_insert" ;;;;"PODE CLOCAR QUALQUER NOME DE BLOCO EXISTENTE NO AUTOCAD QUE ELA IRA FUNCIONAR";;;
(list meio 0) "" "" "" cabo dist) ;;;;ACHO QUE É ALGUMA COISA POR AQUI QUE NÃO ESTÁ FUNCIONANDO;;;;
E AQUI
(command "_insert" ;;;;"PODE CLOCAR QUALQUER NOME DE BLOCO EXISTENTE NO AUTOCAD QUE ELA IRA FUNCIONAR";;;; (list DT1 0) "" "" "" "" )
QUE ELA IRÁ FUNCIONAR.
Agradeço ajuda de você, não sou programador por isso não consigo encontrar o erro. Desde já agradeço.
Avatar do usuário
Carlos Fernando
Concreto
Concreto
Mensagens: 34
Registrado em: Sex 29 Dez 2017 4:17:25 pm

Re: Ajuda Rotina Autolisp

Mensagem por Carlos Fernando »

Saldanha

Modifiquei tanto seu código que acabei fazendo outro kkk
Antes de rodar a rotina abaixo faça o seguinte:

- vc deve substituir o texto "meu_bloco" pelo nome
do bloco que vc quer inserir (entre aspas) e tenha certeza que esse bloco esta na
pasta de caminho de suporte do Autocad;

- crie um estilo de cota somente com o texto, ou seja, suprima a linha de cota e
as linhas de chamadas e coloque o layer que quiser nesse esstilo;

Daí rode a rotina abaixo e selecione as linhas.

Ve se é isso que vc procurava.

Se precisar de mais suporte retorne.

Flw

Código: Selecionar todos

(defun c:red (/ *error* osmode layer op ss i pt1 pt2 pti ptf)
    (vl-load-com)
    (vla-StartUndoMark (vla-get-activedocument (vlax-get-acad-object)))
    (setq osmode (getvar 'osmode)
          layer  (getvar 'clayer)
    )
    (defun *error* (msg)
        (setvar 'osmode osmode)
        (setvar 'clayer layer)
        (vla-EndUndoMark (vla-get-activedocument vlax-get-acad-object))
        (prompt "\nErro ou comando cancelado pelo usuário.")
    )
    (initget "S s N n")
    (setq op (getkword "\Deseja postes? [S / N]: "))
    (setq ss (ssget))
    (setq i 0)
    (while (< i (sslength ss))
        (setq pt1 (cdr (assoc 10 (entget (ssname ss i))))
              pt2 (cdr (assoc 11 (entget (ssname ss i))))
        )
        (command "_dimaligned" pt1 pt2 pt2)
        (if (or (= op "S") (= op "s"))
            (progn (cond ((> (car pt1) (car pt2))
                          (setq ptf pt1
                                pti pt2
                          )
                         )
                         ((> (car pt2) (car pt1))
                          (setq ptf pt2
                                pti pt1
                          )
                         )
                         ((and (= (car pt1) (car pt2)) (> (cadr pt1) (cadr pt2)))
                          (setq ptf pt1
                                pti pt2
                          )
                         )
                         ((and (= (car pt1) (car pt2)) (> (cadr pt2) (cadr pt1)))
                          (setq ptf pt2
                                pti pt1
                          )
                         )
                   )
                   (if (= nil (tblsearch "layer" "PTE_P"))
                       (command "_-layer" "_m" "PTE_P" "")
                   )
                   (setvar 'clayer "PTE_P")
                   (command "_-insert" "meu_bloco" ptf "" "" "")
            )
        )
        (setq i (1+ i))
    )
    (setvar 'osmode osmode)
    (setvar 'clayer layer)
    (vla-EndUndoMark (vla-get-activedocument (vlax-get-acad-object)))
    (princ)
)
SALDANHA
Novato
Novato
Mensagens: 2
Registrado em: Seg 13 Abr 2020 8:40:46 pm

Re: Ajuda Rotina Autolisp

Mensagem por SALDANHA »

Carlos Fernando boa noite, primeiramente que agradecer a ajuda, hoje que estou vendo sua resposta, peço desculpas pela demora, vou analisar e te retorno com o que você fez. Mas já de anti-mão lhe agradeço muito. Obrigado.
FrankJScott
Concreto
Concreto
Mensagens: 28
Registrado em: Sex 06 Mar 2020 12:51:45 pm

Huge fan of this this article :)

Mensagem por FrankJScott »

For the person asking for sites about internet casino software, internet casinos korea players allowed, online casinos with cash sign up bonus, internet casinos korea no deposit bonus, internet casinos no deposit welcome bonus, I highly suggest this online casinos that pay real money website or for internet casinos no deposit korea, internet casinos korea players allowed, new internet casinos, internet casinos for korean players, internet casinos rtg, try this online casinos with free bonus codes profile.
FrankJScott
Concreto
Concreto
Mensagens: 28
Registrado em: Sex 06 Mar 2020 12:51:45 pm

Top Language Strategy In Abu Dhabi

Mensagem por FrankJScott »

For the man asking for websites about autocad mep training in Abu Dhabi, accent training in Abu Dhabi, e-commerce training in Abu Dhabi, public speaking training in Abu Dhabi, web design training in Abu Dhabi, I highly recommend this economics courses in Abu Dhabi profile or for web development training, product design training in Abu Dhabi, accent training in Abu Dhabi, analytics and automation courses in Abu Dhabi, autocad training in Abu Dhabi, maybe this instagram marketing training in Abu Dhabi and aws certification, instagram marketing training in Abu Dhabi, photoshop training in Abu Dhabi, product marketing courses in abu dhab, programming language training in Abu Dhabi, this uae law courses in Abu Dhabi is also a good source of information. Best Personal Development Marketing In Abu Dhabi 49ac76_
FrankJScott
Concreto
Concreto
Mensagens: 28
Registrado em: Sex 06 Mar 2020 12:51:45 pm

Peruse The Most Awesome Stuff Ever

Mensagem por FrankJScott »

HS Codes have explained global industry since 1988, however just a small group of logisticians all over the world understand how to apply them correctly.

In most countries, importers are expected to ascertain the right HS limitations due to their items on the own. Flawed declarations of HS requirements can result in importers paying the wrong amounts of tasks and taxes, which can result in penalties and fines. When coupled with the fact that the big majority of importers have no clue of just how to start classifying their services and products precisely, this results in a tough issue for authorities and traders alike.

HS limitations are identified using the 6 principles of classification printed by the WCO (World Traditions Organization). These principles tend to be more than guidelines or guidelines, as an alternative they MUST be followed when trying to categorize a product. Nevertheless, model of the principles can oftentimes be subjective. They also seriously include the application form of the idea of “crucial character” that is really available to interpretation. Check out Hs code advice for more.

Consequently, traders usually search for brief cuts to determine the right HS codes because of their products. Some simplified HS signal books have already been printed online that seem to work correctly some of the time, but upon sooner examination, you might understand that these versions don't work well when the product itself is complicated.
FrankJScott
Concreto
Concreto
Mensagens: 28
Registrado em: Sex 06 Mar 2020 12:51:45 pm

Look Out For The Finest Items Of 2021

Mensagem por FrankJScott »

When you yourself have an Indian phone number, you are able to get involved with the KBC fortunate draw. KBC can be arranging for another period of Coolest KBC Lottery Winner 2021 advice which has a prize money of 25 lakhs for the KBC supporters who are prepared to participate. In these days countless scam people are creating artificial calls and they'll power you that you've won the honor of lottery from KBC , they will also force one to deliver cash for your cash treasure, please do not give the money, keep for then and confirm from KBC head office quantity contacting them. Favorite callers from the Most Excellent KBC Lucky Draw 2021 tips, it is really simple to engage in KBC happy bring missing any kind of registration. Today, it is simple simply to call at KBC Mind Company number, and that you don't need always to move wherever online. In these times, you could have acquired several KBC lottery scam calls. All Scammer's aim would be to misguide simple people for inexpensive dedication in words and then con them eventually taking income from them. All scammers demands cash they do not want anything more. They send themselves to be the real mind company so you confidence them and spend the quantity they need one to give. We recommend you that you ought not reply to these kinds of call or SMS. For avoiding these kinds of scams, you are able to call the pinnacle company of KBC directly. Get the number from Most Excellent KBC Lucky Draw 2021 info As properly seen your title is in the KBC success record, if you should be maybe not listed in the lottery, then contact us and you can acquire your appropriate lottery number. For just about any factual statements about the KBC lottery winner, you can validate from KBC head company number. KBC Lottery Whatsapp Call can be there to assist the winners to get their income prize easily.independently limited information of someone.
FrankJScott
Concreto
Concreto
Mensagens: 28
Registrado em: Sex 06 Mar 2020 12:51:45 pm

View The Finest Products Online

Mensagem por FrankJScott »

Top Crypto Robot Trading Tools To Look Out For In 2021

Automatic trading platforms driven by configurable crypto trading bots are on the rise. What're the good qualities and drawbacks of these systems, that are the marketplace leaders - and in case you play one? The maturing 24/7 world wide crypto markets, the quick growth of new engineering, and much increased crypto consumer experiences are a number of the converging tendencies driving the development in automated crypto trading platforms. In world wide financial areas, around 75% of trading is algorithmic, and the crypto markets are no different. The final couple of years have observed a rise in how many automated crypto trading programs that use bot pushed cryptocurrency trading strategies. Discover this helpful bitcoin bot tool news for more.

These crypto trading bot platforms combine the benefits of bots (automated, algorithmic 24/7 trading) with multiple customization alternatives, user-friendly interfaces, and the capability to maintain some human oversight. That offers today's crypto traders the capability to develop nuanced, 24/7 trading methods which can be adjusted and sophisticated as needed. There are now a wide variety of programs that appeal to the different wants of the diverse crypto trading and investor community. Some programs are designed for experienced traders and present a range of trading bots that can be connected to any sign and connected to the major crypto transactions via API. These platforms allow traders to generate complex automatic strategies that may be backtested against famous crypto industry data. Try this awesome crypto bot platform advice for more.

There is also a new trend of programs such as created for less experienced traders, and those crypto investors seeking to create a return from their crypto resources with no strain of getting to make trading conclusions themselves. These tools offer replicate trading and cultural trading, and automatic crypto trading based on algorithmic strategies. With the rising interest in DeFi and the yield farming phenomenon, crypto customers are now actually ready to place their resources to perform to create a return. If you are a passive investor, or an energetic trader, there are lots of choices accessible, all with their own chance profile. Try this best crypto bot tool blog for more.
FrankJScott
Concreto
Concreto
Mensagens: 28
Registrado em: Sex 06 Mar 2020 12:51:45 pm

Check Out The Most Awesome Gifts Online

Mensagem por FrankJScott »

Top Crypto Robot Trading Platforms To Search Out For In 2021

Computerized trading platforms driven by configurable crypto trading bots are on the rise. What are the professionals and drawbacks of these platforms, who are the market leaders - and should you use one? The maturing 24/7 global crypto areas, the quick development of new technology, and much improved crypto individual experiences are a number of the converging tendencies driving the development in automated crypto trading platforms. In global economic markets, approximately 75% of trading is algorithmic, and the crypto areas are number different. The final couple of years have observed a rise in the amount of automated crypto trading systems that use robot driven cryptocurrency trading strategies. Try this excellent cryptocurrency bot platform blog for more.

These crypto trading robot systems mix the benefits of bots (automated, algorithmic 24/7 trading) with multiple modification options, user-friendly interfaces, and the capacity to maintain some individual oversight. That provides today's crypto traders the capability to create nuanced, 24/7 trading strategies which can be modified and processed as needed. Nowadays there are a wide selection of systems that appeal to the different needs of the diverse crypto trading and investor community. Some platforms are made for skilled traders and provide a range of trading bots which can be connected to any indicator and linked to the leading crypto transactions via API. These platforms allow traders to create complex automatic techniques that may be backtested against historic crypto industry data. Read this top crypto bot system site for more.

There is also a fresh wave of systems such as for instance made for less skilled traders, and these crypto investors seeking to create a reunite from their crypto resources without the pressure of having to produce trading choices themselves. These systems present copy trading and social trading, and computerized crypto trading based on algorithmic strategies. With the rising fascination with DeFi and the generate farming sensation, crypto consumers are now actually able to place their assets to perform to create a return. If you are a passive investor, or an active trader, there are numerous possibilities available, all with their own risk profile. Read this awesome crypto bot platform url for more.
FrankJScott
Concreto
Concreto
Mensagens: 28
Registrado em: Sex 06 Mar 2020 12:51:45 pm

Look Out For The Most Awesome Stuff Of 2021

Mensagem por FrankJScott »

Top Crypto Robot Trading Systems To Look Out For In 2021

Computerized trading platforms powered by configurable crypto trading bots are on the rise. What are the professionals and drawbacks of the platforms, that are the marketplace leaders - and should you use one? The maturing 24/7 world wide crypto areas, the rapid development of new engineering, and significantly increased crypto consumer experiences are a few of the converging styles operating the growth in automated crypto trading platforms. In international economic markets, approximately 75% of trading is algorithmic, and the crypto markets are no different. The final couple of years have seen a rise in the amount of automatic crypto trading programs that use robot driven cryptocurrency trading strategies. Peruse this great bitcoin bot tool url for more.

These crypto trading robot programs combine the benefits of bots (automated, algorithmic 24/7 trading) with numerous customization possibilities, user-friendly interfaces, and the capability to keep some human oversight. That provides today's crypto traders the ability to develop nuanced, 24/7 trading strategies that may be altered and refined as needed. There are now a wide variety of tools that focus on different needs of the varied crypto trading and investor community. Some tools are designed for experienced traders and provide a selection of trading bots which can be associated with any indicator and connected to the leading crypto transactions via API. These programs let traders to create complicated automated strategies that may be backtested against traditional crypto industry data. Peruse this awesome cryptocurrency bot program blog for more.

There's also a fresh trend of systems such as created for less experienced traders, and these crypto investors seeking to create a return from their crypto resources without the strain of having to create trading choices themselves. These platforms offer replicate trading and cultural trading, and automatic crypto trading centered on algorithmic strategies. With the rising interest in DeFi and the deliver farming sensation, crypto users are now ready to put their resources to work to generate a return. If you are an inactive investor, or an energetic trader, there are numerous possibilities accessible, all with their own risk profile. Read this helpful cryptocurrency bot system tips for more.
Responder