Results 1 to 8 of 8

Thread: List manipulation

  1. #1
    100 Club
    Join Date
    2011-08
    Location
    Vadodara, India
    Posts
    147
    Login to Give a bone
    0

    Default List manipulation

    Hi!

    I have a list which has nos. of vary members.

    (0.816176 6.48044 10.7246 10.3981 1.90985 8.48824 1.69765 3.39529 24.2404 1.63235 22.3306 1.50176 14.7075 17.4335 13.3526 13.3526 14.5769 5.8275 1.25691 11.8019 9.30441 7.72103 8.03118 4.35838 2.17103 3.65647)

    I need help that

    1. Which member have less than 4 than set to 4, and it will deduct from greater than 4.

    Thanks,

    Avinash

  2. #2
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    9,089
    Login to Give a bone
    0

    Default Re: List manipulation

    Maybe a mapcar function would get what you need. However, you have only specified what to do with one condition. The other condition needs more explanation.

    Code:
    (mapcar	(function (lambda (x)
    		    (if	(< x 4.)
    		      4. ;;_ Value is less than 4, therefore set value to 4.0
    		      x ;;_ Return original value
    		    )
    		  )
    	)
    	'(0.816176   6.48044	10.7246	   10.3981    1.90985
    	  8.48824    1.69765	3.39529	   24.2404    1.63235
    	  22.3306    1.50176	14.7075	   17.4335    13.3526
    	  13.3526    14.5769	5.8275	   1.25691    11.8019
    	  9.30441    7.72103	8.03118	   4.35838    2.17103
    	  3.65647
    	 )
    )
    Result
    Code:
        (4.0 6.48044   10.7246	 10.3981   4.0	     8.48824   4.0
         4.0       24.2404	 4.0	   22.3306   4.0       14.7075
         17.4335   13.3526	 13.3526   14.5769   5.8275    4.0
         11.8019   9.30441	 7.72103   8.03118   4.35838   4.0
         4.0
        )
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

  3. #3
    100 Club
    Join Date
    2011-08
    Location
    Vadodara, India
    Posts
    147
    Login to Give a bone
    0

    Default Re: List manipulation

    Thanks for quick reply,

    But I need the summation of all members should be the same before and after both. It will deduct from higher value from it.

  4. #4
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    9,089
    Login to Give a bone
    0

    Default Re: List manipulation

    I think we are having a language issue. I am not following your explanation. Could you post your expected result? Maybe I can decipher from that.
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

  5. #5
    100 Club
    Join Date
    2011-08
    Location
    Vadodara, India
    Posts
    147
    Login to Give a bone
    0

    Default Re: List manipulation

    Hi!

    I have a another logic which you can do for me.

    for about 6202 length



    (25 35 35 35 35 35 282.5 33 48.5 36 80 23.5 5.5 74.5 19.5 92.5 825 105 16.5 679 442.5 43 57 20.5 39.5 247.5 237.5 40 597.5 70 10 38.5 731 462.5 10 367.5 66.5 35 35 35 35 35 25)

    total length = 6202
    Now,
    230/6202 = 0.0370

    now multiply 0.0370 to above dims.

    (0.93 1.30 1.30 1.30 1.30 1.30 10.48 1.22 1.80 1.34 2.97 0.87 0.20 2.76 0.72 3.43 30.59 3.89 0.61 25.18 16.41 1.59 2.11 0.76 1.46 9.18 8.81 1.48 22.16 2.60 0.37 1.43 27.11 17.15 0.37 13.63 2.47 1.30 1.30 1.30 1.30 1.30 0.93)

    now find how many numbers of value have less then 4.

    Say, here 33 nos.

    So, We have to accommodate 33 nos. of dims in 4mm. passage fitted.

    33X4 = 132

    Now summation of that dimensions (33nos.) which dimensions are less then 4 = 4872.5

    now deduction

    6202 - 1329.5 = 4872.5

    now,

    230-132 = 98

    now,

    98 / 4872.5 = 0.020113


    now, remaining dimension multiply by 0.020113 then always coming more than 4.0.



    Thanks,

    Avinash

  6. #6
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    9,089
    Login to Give a bone
    0

    Default Re: List manipulation

    Your expanded explanation left more confusion than enlightenment.

    Your first list of numbers you provided a sum of all the numbers as 6202.0. I got the same amount.

    Then you pulled a new number out of thin air to use in a second mathematical formula. From there, I stopped attempting to understand your problem, which appears to be simple math.

    Your initial problem was to convert all of the numbers in a list that were below a specified value and set those numbers to match the specified value. I am going to wish you good luck in finding your solution as I do not have the time available to work out the problem any further.
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

  7. #7
    100 Club
    Join Date
    2011-08
    Location
    Vadodara, India
    Posts
    147
    Login to Give a bone
    0

    Default Re: List manipulation

    6202 is a actual length of member
    Which has a nos. Of holes.(list1)

    I want to convert it in A4 size of paper. Which has 230 mm length of strip

    So, if we have to fit 6202 length into 230mm strip , we have to reduce as list2 by dividing 230/6202.

    Now, problem is to fit the dimensions in divided value is not possible, so we find minimum dimension is 4 mm.
    Now, if we put it 4 mm in all hoes we can not see that as actual scaling. Like more dims and less dims have same width as 4mm.

    So, this type of logic I derive,
    Just give me solution/help to resolve this above logic.

    Avinash

  8. #8
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    9,089
    Login to Give a bone
    0

    Default Re: List manipulation

    Why not use a layout with a viewport to an appropriate scale for A4 size paper? 6202 / 230 = 26.965

    Round that up to the next tens spot to get 30. You would then have a 1 = 30 scaled drawing.
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

Similar Threads

  1. List Manipulation
    By sdionne422389 in forum AutoLISP
    Replies: 3
    Last Post: 2016-08-02, 03:18 PM
  2. ActiveX API - Dynamic Graphic Manipulation
    By ntaylor in forum API Wish List
    Replies: 8
    Last Post: 2004-11-29, 12:02 AM
  3. ActiveX API - Layer Filter Manipulation
    By ntaylor in forum API Wish List
    Replies: 6
    Last Post: 2004-09-08, 10:58 PM
  4. SCHEDULE MANIPULATION?
    By WATTSAIA in forum Revit Architecture - General
    Replies: 7
    Last Post: 2004-08-08, 06:33 PM
  5. Fast , easier manipulation of edges, vertices and faces
    By Richard McCarthy in forum Revit Architecture - Wish List
    Replies: 4
    Last Post: 2003-10-27, 06:36 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •