CoCreate User Forum

CoCreate User Forum (https://www.cocreateusers.org/forum/index.php)
-   CoCreate Modeling (https://www.cocreateusers.org/forum/forumdisplay.php?f=5)
-   -   HELP! First Lisp Program & of Course Running into Errors (https://www.cocreateusers.org/forum/showthread.php?t=8296)

kdpederson 11-12-2017 01:34 PM

HELP! First Lisp Program & of Course Running into Errors
 
2 Attachment(s)
All,

This is my first attempt at writing a Lisp program. I'm using Notepad++
I have added all of Parker O-ring handbook data for Industrial O-Rings. My goal Would be to have Variables of inside diameter, and cross section for custom Orings, but being able to click on either variable to bring a logical table to select a defined "Dash number" from there it would create a workplane, create a 2d circle, revolve the cross section ,delete the workplane, change the color of the part to black and Density to Nitrile. I have been continuously loading to check if the lisp works before adding more data, so before I could even get to the workplane and such I get an error "Odd Length of keyword-value pair list in ORING-CREATOR: (DIALOG-TiTLE..

I have attached the Code and Image of the Error.

Updated the Code with Marten Comments from Below.

Marten 11-13-2017 03:20 AM

Re: HELP! First Lisp Program & of Course Running into Errors
 
Yes, those errors can be hard to track down if your new to lisp. The problem in your file is that you have not named your local function and don't have any content in your ok-action:

Code:

    :local-functions '(   
        (create ()
            (sd-call-cmds    (create_workplane :new :name "Ring"))
        )
    )
    :ok-action '(create)

When you change to the code above your command loads without errors.

Regards,

Marten

kdpederson 11-13-2017 06:25 AM

Re: HELP! First Lisp Program & of Course Running into Errors
 
Thanks Marten! one side issue I was having was trying to attach an Image to the code. Am I able to attach an image to something I have stored local?

Marten 11-13-2017 11:22 PM

Re: HELP! First Lisp Program & of Course Running into Errors
 
Do you mean you want to show an image in the command dialog? You can do that. You have to define a variable of type 'image'

Code:

        (picture 
            :value-type :image
            :image-file path-to-image
        )

hth

Marten

kdpederson 11-16-2017 05:13 AM

Re: HELP! First Lisp Program & of Course Running into Errors
 
1 Attachment(s)
Thanks to everyone for your help. attached is Lisp file if anyone else needs such a thing.


All times are GMT -8. The time now is 11:13 PM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.