Jump to content

Updating lisps


Forbes

Recommended Posts

Although we have moved on to 3D modelling, most of my clients still require a basic 2D Layout. 
Over the years I have collected and modified AutoCAD menus to suit my needs, starting with Mech 11 in 1990.

At present, I am using stl.lsp revised by Allan Wise with USA and AUS steel sections, which I have modified it to suit South African steel sections.
It is a great lisp, and I find it very handy.

I have steel sections lisps which I previously used which run off pull-down or drop down dialogue boxes, but with the CUI menu and ribbon format they are not ideal to use as they populate the command dialogue box with the lists of the member sizes.

I would prefer to use some of my old lisps for sections as the gives the option of drawing a beam for example from the top, center or bottom of the member and various other things, however ideally the lisps need to be modified to run with dcl files, and unfortunately while I understand and can follow the process, I agree with what was posted by someone else on the forum, I don't have the ability to modify the lisps.

My question is, is there anyone on the forum who would be prepared to take my lisps and modify the lisps and incorporate them into the stl.lsp for me.
Any help would be appreciated.

Regards,
Link to comment
Share on other sites

As an example replace this with radio buttons 


(getkword "\nLocate from  <T>op  <C>enter  <B>ottom:  "))
        (cond ((= ans "T") (setq PT1 PT1B))  ;top
          ((= ans "C") (setq PT1 PT1))   ;center
          ((= ans "B") (setq PT1 PT1A))  ;bottom
      ) )

 

If you search for Grr and dcl he has some really great dcls that replace this type of question it means the user does not take their eyes of the screen. I have posted many times getvals3.lsp which is a library routine rather than hard coding into individual routines.

 

The best way is to take a library approach to your coding asking questions for user input, doing layer stuff much easier to have 1 line in your routine than copying and pasting into every bit of code.

 

 

  • Thanks 1
Link to comment
Share on other sites

Thanks for the feedback BIGAL, I will see what I can find.

The lisp I want modified has that condition:-

 

(defun PTSEL (/ ans)
       (cond
      ((= TOG "S")                        ;drawn in section
        (initget 1 "T C B")
        (setq ANS
        (getkword "\nLocate from  <T>op  <C>enter  <B>ottom:  "))
        (cond ((= ans "T") (setq PT1 PT1B))  ;top
          ((= ans "C") (setq PT1 PT1))   ;center
          ((= ans "B") (setq PT1 PT1A))  ;bottom
      ) )
      ((or (= TOG "E") (= TOG "P"))   ;draw in plan or elevation
        (initget 1 "LL TL TR LR CL CR")
        (setq ANS
          (getkword "\nLocate from LL TL TR LR CL CR:  "))
          (cond ((= ANS "LL") (setq PT1 PT2))  ;lower left
            ((= ANS "TL") (setq PT1 PT5))  ;top left
            ((= ANS "TR") (setq PT1 PT4))  ;top right
            ((= ANS "LR") (setq PT1 PT3))  ;lower right
            ((= ANS "CL") (setq PT1 PT6))  ;center left
            ((= ANS "CR") (setq PT1 PT7))  ;center right
      )   )
)      )

Unfortunately while I can follow both the dcl and lisp option, I don't have the brainpower to edit them.

 

I will go through Grrr's post and see what I can find.

 

Link to comment
Share on other sites

Ok try this load radiobuttons4  1st, this is a bit rough and not properly tested, you can make a new version that is 3 radio butons by removing the repeating lines that make the total number of buttons see val1 val2 etc


(if (= TOG "S")
   (progn
   (if (not Ah:Butts4)(load "Radio buttons4"))
  (AH:Butts4 "Choose Top Centre Bottom X " "T" "C" "B" "X")
      (cond ((= val1 "1") (setq PT1 PT1B))  ;top
           ((= val2 "2") (setq PT1 PT1))   ;center
         ((= val3 "3") (setq PT1 PT1A))  ;bottom
       )
       (setq val1 nil val2 nil val3 nil val4 nil)
 )
 )

 

Radio buttons4.lsp

Edited by BIGAL
Link to comment
Share on other sites

Thanks for the feedback BIGAL, I think my first post may have been a bit misleading, so I will try and explain it a bit better.

Before AutoCAD converted to CUI files, I used the menu file attached to run my steel sections lisps. (I have attached the Beam lisp as an example of one of the  lisps I want to update to run from the .dim and .dcl files). 

I have created the Stl_UB.dim file for the values the Beam.lisp needs to read, but I haven't edited the Stl.dcl file for the UB/Beam sections yet.

 

My problem is I know the lisp needs to read the .dim file to get the values, and read from the .dcl file, and although I can follow the lisp, I don't have the ability to modify it.

If I had a working example, I could probably edit the other lisps to run the same way.

 

With regard to the positioning of the member, I am happy to leave it in the lisp (preferably with the option of either typing or mouse selection), because when you run the channel and angle lisps, the variables are back, front center etc., not top center and bottom.

 

I would like to get the lisp running and then try and tweak it.

 

Your help, or if someone else on the forum can help, it would be much appreciated.

Stl.dcl

Stl.lsp

Stl_UB.dim

Beam.lsp

Steel.mnu

Link to comment
Share on other sites

There is a lot of stuff here that could be changed, some would be user preferences for me the menu has all the beam sizes info I would have that in a text file. Using a dcl you can call sub dcls so the obvious is to take advantage of this and have a top dcl with simple example BEAM, COLUMN which opens another dcl where you could select the type of Beam I, Round, Square. Then a dcl list so you pick.

 

Some of the (load "start") etc can be replaced with a (if (not "started")) so its not loaded every time, same with the findfile if you add a "steal" directory to the support path then findfile is not required.

 

Need some feed back from others 

 

ScreenShot143.jpg

Edited by BIGAL
Link to comment
Share on other sites

Thanks for the feedback BIGAL. Having read through quite a lot of posts on this forum, regarding the use of dcls and lists etc., I have absolutely no doubt that what I have posted is primitive by comparison to what you guys are doing, and the routines could be be made a lot more effective than they are, but as I have mentioned, I just don't have the know how to do it, so I was aiming to get what I have running as effectively as I could with the least amount of work.

 

If there is someone out there who wants to take the menu and lisps and turn them on its head to be more effective, great, if not, I would be happy with them working.

 

These lisps were written in the early 1990's, I just modified what I could, I am now twenty years older and more stupid when I see what is going on now.

Edited by Forbes
forgot to add something
Link to comment
Share on other sites

On 11/25/2018 at 4:57 PM, Forbes said:

My question is, is there anyone on the forum who would be prepared to take my lisps and modify the lisps and incorporate them into the stl.lsp for me.

 

Yes, there are bunch of guys out here that could help you. Unfortunately your question is more of a request, and its not an easy one to perform:

The reason is not a lack of skills of one, but more because of the tremendous code you provdied, that uses alot of repetitive code blocks,

so in addition the whole code needs to be rewritten more effectively, so easier modifications/features could be applied to it.

On top of all it uses DCL, that overwhelms even more the reader.

 

For short yes, there are people that can help you, but I don't think they'll have the free time and will.

So your shortcut would be to hire someone.

Link to comment
Share on other sites

Like Grrr its a big job lots of code. I would just improve things one at a time like the initget replaced with dcl's using a couple of library DCL's would cover this easily as I suggested with the radio buttons you can have a routine that accepts as many buttons as you need but its only one program. I have started replacing all get's in my code where possible with DCL with default values. You will see this often in what I post now.

 

As you mention in the 1990's dcl's were not used much everything was menus and lost of ifs.

 

I would look at a different approach you may be better looking at current package this would be up to date 2019 etc, it probably has way more than what you want or has stuff that you did want and don't have now.  Have a look at Strucplus others will make suggestions.

 

If I was to rewrite I would base it around a number of library defuns so code is not continually duplicated, one thing I worked on was user layers within the code so for most it was not hardcoded to what got drawn on which layer, rather a layer variable.

Edited by BIGAL
Link to comment
Share on other sites

Thanks for the feedback guys, I was obviously looking at the whole thing from the wrong understanding.

My logic told me that if for example if you had two old Ford cars, one with fuel injection (dcl/lisp) and one without, it wouldn't be too big a problem to take the parts you want from the non-fuel injected car and swap them over to the fuel injected car.

That way you still have an old car, but with the stuff you wanted in it.

 

You are talking about a complete makeover, which I understand would cost time and money and for the amount of time I spend using AutoCAD it wouldn't be worth it..

 

I was hoping to get the extra features without a major makeover, realising that the lisps are old and the technology has moved a long way forward.

 

With regard to Strucplus, I looked at it on the net, and the going price is around $2k and with the rand conversion it works out at nearly R27k.

I already have Tekla Structures which I am sure does all that Strucplus does and more, so it is not worth even considering as an option when all I want is about four lisps modified. (one if I can figure out how the first was done)

 

The mods would be a "nice to have", but If I can't find anyone to modify what I have, it is not a train smash, I can still use what I have.

I would be prepared to pay if the cost was affordable, but with our exchange rate as it is, it makes it very difficult.

 

Thank you for your advice and input.

 

Regards,

 

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