CoCreate User Forum  

Go Back   CoCreate User Forum > Applications > CoCreate Modeling

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 11-12-2017, 01:34 PM
kdpederson kdpederson is offline
Registered User
 
Join Date: Jan 2014
Location: Iowa
Posts: 10
Exclamation HELP! First Lisp Program & of Course Running into Errors

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.
Attached Thumbnails
Click image for larger version

Name:	Oring_Error.jpg
Views:	427
Size:	24.3 KB
ID:	1963  
Attached Files
File Type: lsp O-RING.lsp (17.7 KB, 467 views)

Last edited by kdpederson; 11-13-2017 at 10:23 AM.
Reply With Quote
  #2  
Old 11-13-2017, 03:20 AM
Marten Marten is offline
Registered User
 
Join Date: Feb 2006
Location: Tilburg, The Netherlands
Posts: 139
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
Reply With Quote
  #3  
Old 11-13-2017, 06:25 AM
kdpederson kdpederson is offline
Registered User
 
Join Date: Jan 2014
Location: Iowa
Posts: 10
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?
Reply With Quote
  #4  
Old 11-13-2017, 11:22 PM
Marten Marten is offline
Registered User
 
Join Date: Feb 2006
Location: Tilburg, The Netherlands
Posts: 139
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
Reply With Quote
  #5  
Old 11-16-2017, 05:13 AM
kdpederson kdpederson is offline
Registered User
 
Join Date: Jan 2014
Location: Iowa
Posts: 10
Re: HELP! First Lisp Program & of Course Running into Errors

Thanks to everyone for your help. attached is Lisp file if anyone else needs such a thing.
Attached Files
File Type: lsp O-RING.lsp (19.6 KB, 531 views)
Reply With Quote
Reply

Tags
error, lisp, lsp, o-ring, oring


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 05:22 AM.



Hosted by SureServer    Forums   Modeling FAQ   Macro Site   Vendor/Contractors   Software Resellers   CoCreate   Gallery   Home   Board Members   Regional User Groups  By-Laws  

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