dipcad 发表于 2022-7-6 11:08:47

Draw an 50*50*6 angle

I would like to draw 50*50*6an angle,14000mm length & insert a block, I also draw a two cg line with cetane distanc. I wrote this Lisp. Which is not work properly. I am an old gay. please clarifythis lisp file where is wrong.
 
Lisp file is given below:
 
(Defun c:CbEl ()
(setq tlen (getreal "\nEnter total span of cable Bridge:"))
(setq en1 (getint "\nEnter No. of equal span:"))
(setq esln (getreal "\nEnter eual span length:"))
(setq en2 (getint "\n No. of last span:"))
(setq ept1 (getpoint "\n Pick Start Point of Elevision:"))
(setq tang (getint "\nEnter top chord angle:"))
(setq tcg (getreal "\nEnter TopChord Beam Angle CG length:"))
(setq bang (getint "\nEnter bottom chord angle:"))
(setq bcg (getreal "\nEnter BottomChord Beam Angle CG length:"))
(setq ebm (getint "\nEnter UB SEction :"))
(dcgl)
(Dbch)
   ;(Dtch)
)
(defun dcgl (/ bcscg bcecg tcscg tcecg)
(setq bcscg (polar ept1 1.5708 bcg))
(setq bcecg (polar bcscg 0 tlen))
(setq tcscg (polar ept1 1.5708 (- 2150 tcg)))
(setq tcecg (polar tcscg 0 tlen))
(command "color" 1)
(command "line" bcscg bcecg "")
(command "line" tcscg tcecg "")
(command "zoom" "extents" "")
(command "color" "Bylayer")
)
(defun Dbch (/ bctm bctm2 bcsp bcep bctsp bctep bcfsp bcfep)
(setq bctm (polar ept1 0 (/ tlen 2)))
(setq bctm2 (polar bctm 1.5708 500))
(if (equal ebm 203)
    (progn
      (Command "insert" "E203" ept1 "" "" "")
      (command "mirror" "last" "" bctm bctm2 "")
      (setq bcsp (polar ept1 0 86.6))
      (setq bcep (polar ept1 0 (- tlen 86.6)))
    )
    (progn
      (Command "insert" "E254" ept1 "" "" "")
      (command "mirror" "last" "" bctm bctm2 "")
      (setq bcsp (polar ept1 1.5708 93.2))
      (setq bcep (polar ept1 0 (- tlen 93.2)))
    )
)
(setq bctsp (polar bcsp 1.5708 6))
(setq bctep (polar bcep 1.5708 6))
(setq bcfsp (polar bcsp 1.5708 bang))
(setq bcfep (polar bcep 1.5708 bang))
(command "color" 3)
(command "line" bcsp bcep bcfep bcfsp "c")
(command "line" bctsp bctep "")
(command "color" "Bylayer")
)
 

alanjt 发表于 2022-7-6 11:29:22

 
We don't care about your sexual preferences.

MSasu 发表于 2022-7-6 12:06:21

Posting a picture of what you want to achieve may help someone to debug your code.
At first glance your code is inserting a predefined block – make sure that is placed on a search path or provide the appropriate path in code (if not already defined in current drawing’s database).
 
Regards,
 
PS. Please don’t forget to format your codes to increase visibility.

dipcad 发表于 2022-7-6 12:17:44

We used a dwt file which contain block. Also when i watch variable value it show correct value. but when exicute or draw it does not work properly. also if we run it in R14 some time it exicute but in AutoCAD2009 it was not execuite properly.
页: [1]
查看完整版本: Draw an 50*50*6 angle