Jump to content

Looking for someone to help with somewhat extensive LISP program to solve error


Colsen87

Recommended Posts

I need to find an advanced user to help troubleshoot an AutoLISP program that is in four parts. The program is proprietary and pretty extensive so I don't know that posting it directly to this forum is an option.

 

 

I am having a specific issue where a calculation is calling information from a list. I do not understand where this list is created within the code that I have and what information that it is pulling. I know what information I need it to pull and luckily the information that I need is already programmed into another calculation I am just unsure how to get the information I want into the correct list for use. If you think you can be of assistance let me know and we can discuss how to get the code to you.

 

 

Thank you in advance.

Link to comment
Share on other sites

Thank you for the quick response, I have attached the program for your review. Let me give you a little breakdown of how it works and then I will explain the issue that I am having.

 

How it Works:

 

 

The first file that is called when the program is run is the G.LSP. This file gets the required user input to perform the required calculations for three types of drawings, the girder calculation drawing/camber diagram, the blocking diagram, and web cutting drawing. It sets up the calculations and then stores the required information in a set of lists. It then sets up and draws the girder calculation sheet and calls the other lsp files.

 

 

The BD.LSP file takes the input from the G.LSP file and creates the blocking diagram. I don't have any issues with this I just included it so that nothing was missing.

 

 

The third and fourth lsp files work togther. wc.lsp takes the input needed from the G.lsp file and runs the calculations needed to figure out the end cuts. The wcd.lsp then creates the web cutting drawing based on the input;

 

 

The Problem:

 

 

The girder calculation and blocking diagram works exactly how it needs to. Where I am having an issue is with the calculations for the web cutting, specifically these lines of code:

 

 

; Calculates vertical, hypotenus and angle for each section and adds to list
(mapcar '(lambda (x)


		; Calculate vertical, hypotenus and angle (degrees)
		(setq
			vert		(* (- last_cadr (cadr x)) -1.0)
			hyp		(expt (+ (expt vert 2.0) (expt (car x) 2.0)) 0.5)
			ang		(rtd (atan vert (car x)))
			vha_list	(cons (list vert hyp ang) vha_list)
			last_cadr	(cadr x)
		)
	)
	wc_list
)

 

 

 

I cannot figure out where last_cadr, cadr x, and car x come from. I know what the syntax car and cadr mean in relation to lists but I cannot pinpoint where list x that is being used is defined.

 

 

The calculations run and come out close, but they are not exact. This is because they are using the wrong piece of information from the girder calculations output. There are two numbers that are calculated that are usually very close and it is using one and not the other. If I can nail down specifically where the information is coming from I can tell it to use the other number from the output.

 

 

I think the information above comes from the g.lsp file but I am not sure. The code below is where I was thinking it came from:

 

 

; Web cutting calc
		(setq
			wc_list	(cons (list fs_l fs_hl_gl) wc_list)
		)

 

 

 

 

 

If you aren't completely confused at this point and can help that would be greatly appreciated.

Edited by SLW210
Code Tags
Link to comment
Share on other sites

Welcome to CADTutor! :)

Having stated that the program is proprietary, I suggest you delete the attachments,

once you have confirmation from pBe that he has gotten them.

You can select the EDIT POST option and delete the attachments lest they quickly lose their

proprietary status.

Link to comment
Share on other sites

You know what Colsen87 , Dadgad made a good point , I was expecting you would send me a PM [Private Message] so go ahead and delete the attachments.

 

I'll have a look see.

 

[wrote you a VISITOR message]

Edited by pBe
Link to comment
Share on other sites

Thank you for the heads up. I am still new to the forum and did not realize private messaging was an option. Now to figure it out so that I can send pBe the rest of the info he is requesting.

Link to comment
Share on other sites

I am afraid that posts to the Community part of the forum do not add to the post count. But if you thank me for this information in this thread, your post count will be increased by one.

 

Good luck in your endeavours :D

Link to comment
Share on other sites

pBe since there is some urgency in my trying to get this program figured out, and since I do not have permissions to send private messages yet, I will attache the two files you requested on here. Please let me know when you have them so that I can take them back down. Since everything has been posted in pieces the program should be fairly safe for now.

Edited by Colsen87
Link to comment
Share on other sites

The way around all this is by posting your email in a form that is not easily recognizable to a bot. Then pBe can touch base with you. Example...

 

x c o l s e n AT a t t DOT n e t

Link to comment
Share on other sites

eldon, I did in fact miss your post. I did read it, however I ran it together and though that it was a response from one of the other members. Thank you for then input by the way! (and after I already took the time to introduce myself lol)

Link to comment
Share on other sites

pBe, one other thing that I thought of. You can use the file attached to this link for the input (rather than trying to use input that might not work anyway) to help troubleshoot the program.

Edited by Colsen87
Link to comment
Share on other sites

so in other words, open CAM1 (input drawing). Use the Alpha.lsp to call the G.lsp (you may just be able to load the G.lsp by itself if you put all the .lsp files that I sent you into one directory and point to it in the support file search path in AutoCAD. When you run G.lsp it should ask for some additional user input. Since this should be post number 10 I will private message you all of this information all the files and information I have posted so far.

Link to comment
Share on other sites

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