Jump to content

Recommended Posts

Posted

why do i get this error message in this lisp?

 

Unknown command "N". Press F1 for help.

Unknown command "VV". Press F1 for help.

 

 

;;;Vv - Calculates the weight a steelplate based on given in of plate thickness and a hatch or polyline object.
:::Using a mass proberties of 7850 kg/m3 of steel plate.

(defun c:vv ( / oldlayer oldcmdecho oldosnap ctextstyle fae thk wgt frar frarr fwgt fwgtm far farsf fip )
(setvar "OSMODE" 0)
(setvar "cmdecho" 0)
(setq oldlayer   (getvar "clayer"))
(setq oldcmdecho (getvar "cmdecho"))
(setq oldosnap   (getvar "osmode"))
(setq ctextstyle (getvar "textstyle"))
(Command "-style" "WEIGHT" "ISOCP.shx" "3.5" "1" "0" "n" "n" "n")
(if (not (tblsearch "LAYER" "AM_WEIGHT"))
(Command "-layer" "n" "AM_WEIGHT" "c" "6" "AM_WEIGHT" "s" "AM_WEIGHT" "P" "N" "AM_WEIGHT" "")
(setvar "clayer" "AM_WEIGHT"))
(command "-color" "BYLAYER" "")
(prompt "\nChoose Polyline or Hatch for area and weight calculation: ")
(setq fae (car (entsel)))
(Command "area" "e" fae)
(setq thk (getreal "\nThickness of plate? in mm: "))
(setq wgt (* thk 7850))
(setq frar (/ (getvar "area") 1))
(setq frarr (/ (getvar "area") 1000000))
(setq fwgt (* frarr wgt))
(setq fwgtm (/ fwgt 1000))
(setq far (rtos fwgtm 2 4))
(setq farsf (strcat "Plate thickness = " (rtos thk 2 2) "mm. -- Area =" (rtos frar 2 4) " mm2. -- Area =" (rtos frarr 2 4) " m2. -- weight = " far " kg./plate"))
(setq fip (getpoint "\nChoose Text Insert Point:"))
(Command "text" "s" "WEIGHT" "j" "MC" fip "45" farsf)
(command "-layer" "s" oldlayer "")       
(command "-color" "BYLAYER" "")
(setvar "TEXTSTYLE" ctextstyle)
(setvar "OSMODE" oldosnap) 
(setvar "CMDECHO" oldcmdecho) 
(princ)
)

 

 

Thx in advance! :?

Posted

Start here (see the colored code below) :thumbsup: :

 

;;;Vv - Calculates the weight a steelplate based on given in of plate thickness and a hatch or polyline object.
[color=red]:::[/color]Using a mass proberties of 7850 kg/m3 of steel plate.

Posted

Only need 2 "n" in ..."-style" ...

and no "" at the end of (command "-color" ...

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...