Jump to content

Recommended Posts

Posted

I dont't do much LISP and I have this error when I run my LISP:

bad DXF group: (10 PT1)

 


defun C:BRC (/ pt1 pt2)


 (setq pt1 (getpoint "\nEnter the first point on the contour ")


pt2 (getpoint pt1 "\nEnter the second point on the contour: ")


 )


 (command "_.break" pt1 pt2 "")


 (entmake


   '((0 . "POLYLINE")


;;;      (cons 8 "Mask")


     (66 . 1)    ; Vertices follow


    )


 )


 (entmake '((0 . "VERTEX") (10 pt1)))


 (entmake '((0 . "VERTEX") (10 pt2)))


 (entmake '((0 . "SEQEND")))





 (princ)


)

 

Can someone tell me what was wrong?

Thanks all,

Posted

Hi,

 

Try

 

(entmake ([color="blue"]list [/color]'(0 . "VERTEX") ([color="BLUE"]cons [/color]10 pt1)))

 

Instead of

 

(entmake [b][color="red"]'[/color][/b]((0 . "VERTEX") (10 pt1)))

 

This allows AutoCAD pass the value of pt1 into the expression before trying to ENTMAKE the VERTEX

 

Regards

 

Jammie

 

Jammie

Posted

Thanks Jammie for the quick reply,

I got this error with ur code:

Invalid complex object.

I will try other variations of ur code and see,

Posted

Maybe the 10 group is missing from the polyine line call

 

This is a very old snippet

 

;*** Req'd fields


(entmake (list (cons 0 "POLYLINE") ;***
              (cons 6 "BYLAYER")
              (cons 8 "0")
              (cons 10 (list 0.0 0.0 0.0)) ;***
              (cons 39 0.0)
              (cons 40 0.0)
              (cons 41 0.0)
              (cons 62 256)
              (cons 66 1)
              (cons 70 0)
              (cons 71 0)
              (cons 72 0)
              (cons 73 0)
              (cons 74 0)
              (cons 75 0)
              (cons 210 (list 0.0 0.0 1.0))))
(entmake (list (cons 0 "VERTEX") ;***
              (cons 6 "BYLAYER")
              (cons 8 "0")
              (cons 10 (list 0.0 0.0 0.0)) ;***
              (cons 39 0.0)
              (cons 40 0.0)
              (cons 41 0.0)
              (cons 42 0.0)
              (cons 50 0.0)
              (cons 70 0)
              (cons 71 0)
              (cons 72 0)
              (cons 73 0)
              (cons 74 0)
              (cons 62 256)))
(entmake (list (cons 0 "VERTEX") ;***
              (cons 6 "BYLAYER")
              (cons 8 "0")
              (cons 10 (list 1.0 0.0 0.0)) ;***
              (cons 39 0.0)
              (cons 40 0.0)
              (cons 41 0.0)
              (cons 42 0.0)
              (cons 50 0.0)
              (cons 70 0)
              (cons 71 0)
              (cons 72 0)
              (cons 73 0)
              (cons 74 0)
              (cons 62 256)))
(entmake (list (cons 0 "SEQEND") ;***
              (cons 8 "0")))

 

http://www.theswamp.org/index.php?topic=4814.msg57862#msg57862

 

-David

Posted

Thanks David,

I will try to add the 10 group to the POLYLINE line when I have access to ACAD Tomorrow morning,

Posted

hi jammie,

I am sry ur code is perfect, I made a mistake by using pt1 twice instead of pt2 for the second point,

David,

I think the 10 group is not required for polyline,

thanks everyone, this is only the beginning - I am trying also to add label to the contour using the contour elevation,

I will see how it is going and post,

Posted

@morgos,

 

Glad to have helped & good work getting your code working

 

Regards

 

Jammie

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