Jump to content

Recommended Posts

Posted

I would like to draw 50*50*6 an 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 clarify this 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")

)

 

:)

Posted
I am an old gay.

 

We don't care about your sexual preferences. :lol:

Posted

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.

Posted

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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...