Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

error in code using member function

7 REPLIES 7
SOLVED
Reply
Message 1 of 8
M_H_G_M_G
260 Views, 7 Replies

error in code using member function

Hello every one 
this a part of code and this inside a cond function 
I've a list with name ColumnB and i need to make 
if member in columnB equal any item of the list 

'("ACROW FRAME-P" "Shore Brace Frame (H) (plan) 6221177009366" "CUPLOCK PLAN" "beam bracket" "cant. bracket(Plan)1")
make the function that i've made (
insert-spigot-jack-plate)

then i've a problem that the function (insert-spigot-jack-plate) repeated by the number of matching between the ColumnB and the list  '("ACROW FRAME-P" "Shore Brace Frame (H) (plan) 6221177009366" "CUPLOCK PLAN" "beam bracket" "cant. bracket(Plan)1")

if the 5 items exist in columnB list the function (insert-spigot-jack-plate) repeated 5 times 
i just need to make it one time if one item at least exist or even the five items exist 

How to make this 

thanks in advance 



 

 

            (
             (member ColumnB '("ACROW FRAME-P"
                               "Shore Brace Frame (H) (plan) 6221177009366" 
                               "CUPLOCK PLAN" 
                               "beam bracket" 
                               "cant. bracket(Plan)1"))

             (progn 

            (insert-spigot-jack-plate "Base Jack" jack_total jack_calc)
            (insert-spigot-jack-plate "Base Plate" plate_total plate_calc)
            (insert-spigot-jack-plate "U-Head Jack" U_Head_total  U_Head_calc )
               
             )
            )

 

7 REPLIES 7
Message 2 of 8
ec-cad
in reply to: M_H_G_M_G

Something like this might do it.

           (setq FLAG 0); Init Flag value ; add this somewhere above, in loop

; START of Cond
           (
             (member ColumnB '("ACROW FRAME-P"
                               "Shore Brace Frame (H) (plan) 6221177009366" 
                               "CUPLOCK PLAN" 
                               "beam bracket" 
                               "cant. bracket(Plan)1"))

             (progn
;; ADD
              (if (= FLAG 0)
               (progn
                (insert-spigot-jack-plate "Base Jack" jack_total jack_calc)
                (insert-spigot-jack-plate "Base Plate" plate_total plate_calc)
                (insert-spigot-jack-plate "U-Head Jack" U_Head_total  U_Head_calc )
                (setq FLAG 1)
               ); progn
              ); if
;; END OF ADD
             )
            )
;; END of Cond

ECCAD

 

Message 3 of 8
M_H_G_M_G
in reply to: ec-cad

Thanks sir
it works correctly
Message 4 of 8
ec-cad
in reply to: M_H_G_M_G

You are very welcome. Come back anytime.

🙂

ECCAD

Message 5 of 8
ec-cad
in reply to: M_H_G_M_G

Sent you a PM on it. Your latest code fragment is attached, along with a test drawing.

Seems to work now. Look for "<---" comments, showing what I changed.

 

ECCAD

 

Message 6 of 8
M_H_G_M_G
in reply to: ec-cad

yes sir
thanks it worked correctly …

Message 7 of 8
ec-cad
in reply to: M_H_G_M_G

Good, glad to hear that !

I know you need more data types to add, should be a huge program once completed.

You (could) save those portions you are not using (outside) the main program, cut/paste

back in when needed. Just a suggestion.

And, make 'specific' functions to call the sorting routines.

One sample would be to put the 'new' Table startup into a seperate function, and call it.

 

ECCAD

Message 8 of 8
M_H_G_M_G
in reply to: ec-cad

thanks sir 
it's a good idea 
I sent something to you in the mail 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Forma Design Contest


AutoCAD Beta