Jump to content

Attributes be added to factor the outcome of Incremental numbers


Recommended Posts

Posted

RE: PNO lisp: Can additional attributes be added to factor the outcome of Incremental numbers?  When I review the  PNO lisp I keep wondering, can the results of assigned incremental number in "Port_Number" attribute be secondarily ordered by a 2nd attribute "Sort_Order2" value after the 1st "Sort-Order" value?  AND possibly by 3rd priority sort of 3rd attribute's alphabetic  value in a 3rd attribute "Sort_Order3"?   These option, if possible, would allow more control of the assigned incremental numbers.  Attached is blocks as example.

PNO TEST-LSP FOR NUMBING2.dwg

Posted (edited)

To Admin this is really a new task, as its the posters first post. Does not match this post.

 

You can sort multiple attributes in a order of attributes. I have some thing that works for up to 5 attributes deep. It pads missing attrbute values, so can have say 1 or up to 4 attribute values. I need some time to have a look at say add a "002" block and find highest attribute value of existing blocks.

 

("DATAPORT NUMBER" "001" "1000" "001" "") 
("DATAPORT NUMBER" "002" "1200" "002" "") 
("DATAPORT NUMBER" "002" "1200" "002" "Tomorrow") 
("DATAPORT NUMBER" "002" "1200" "002" "Yesterday")
("DATAPORT NUMBER" "003" "1200" "001" "") 
("DATAPORT NUMBER" "004" "1350" "" "")
("DATAPORT NUMBER" "005" "1400" "" "") 
("DATAPORT NUMBER" "006" "1500" "" "") 
("DATAPORT NUMBER" "007" "1600" "" "")
("DATAPORT NUMBER" "008" "1700" "" "") 
("DATAPORT NUMBER" "009" "1800.9" "" "")
("DATAPORT NUMBER" "010" "1900" "" ""))

 

 

Edited by BIGAL
Posted

Thanks Bigal for looking into this. 

The goal is to have incremental number input into Attribute "Port_Number" based on level of priority..Sort_Order then Sort_Order2 then Sort_order3.  The first and second attributes would always have a value, but the third attribute may at time be empty. Ideally when many blocks that share the same values in the 1st 2 attributes, the lisp looks to the 3rd for direction for the next incremental number assignment. 

Posted

Yes.. the layout you show is what I was thinking of.   Attached here is the PNO lisp from earlier in this thread that  I was hoping could be altered to do that.  Thanks

pno.LSP

Posted

I got to thinking.. if blocks represent parts and multiple similar Parts exists the same assigned number should be same for similar parts. So after adding  Part_Number attribute could the lisp runs the  below results?  (graphically like column order in a table, but the way the order lisp sorts).  I see issues if Part_Number and other Sort Orders values don't match when hoping for blocks with same part number to be assigned same Dataport Number.  So there would need to be a warning if that occurs. Hope this makes sense.

 

DATAPORT_NUMBER -->  order by--> | Sort_Order | Sort_Order2 | Sort_Order3 | <--Part_Number

"001" --> "1000" "001"   "" <--  "DD3" 

"002" -->"1100" "003"    "" <-- "PIE"

"002" -->"1100" "003"    "" <-- "PIE"

"003" -->"1200" "1"    "" <-- "APPLE"

"004" -->"1200" "001" "Tomorrow" <--"PEAR"

"005" --> "1200" "001" "Tomorrow"<--"PEACH"

"005" -->"1200" "001" "Tomorrow" <--"PEACH"

"006" -->"1200" "001" "Yesterday" <--"CHERRY"

"007" -->"1250" "" "" <--Box

"007" -->"1250" "" "" <--Box

"008"-->"1350" "" "" <- Chocolates

"009" -->"1400" "" "" <--Pickles

etc

PNO TEST-LSP FOR NUMBING3.dwg

Posted

I got to thinking.. if blocks represent parts and multiple similar Parts exists the same assigned number should be same for similar parts. So after adding  Part_Number attribute could the lisp runs the  below results?  (graphically like column order in a table, but the way the order lisp sorts).  I see issues if Part_Number and other Sort Orders values don't match when hoping for blocks with same part number to be assigned same Dataport Number.  So there would need to be a warning if that occurs. Hope this makes sense.

 

DATAPORT_NUMBER -->  order by--> | Sort_Order | Sort_Order2 | Sort_Order3 | <--Part_Number

"001" --> "1000" "001"   "" <--  "DD3" 

"002" -->"1100" "003"    "" <-- "PIE"

"002" -->"1100" "003"    "" <-- "PIE"

"003" -->"1200" "1"    "" <-- "APPLE"

"004" -->"1200" "001" "Tomorrow" <--"PEAR"

"005" --> "1200" "001" "Tomorrow"<--"PEACH"

"005" -->"1200" "001" "Tomorrow" <--"PEACH"

"006" -->"1200" "001" "Yesterday" <--"CHERRY"

"007" -->"1250" "" "" <--Box

"007" -->"1250" "" "" <--Box

"008"-->"1350" "" "" <- Chocolates

"009" -->"1400" "" "" <--Pickles

etc

PNO TEST-LSP FOR NUMBING3.dwg

Posted

I posted elsewhere about sorting attributes say up to 5 attributes deep and a list Is made, the next step is the list is counted so the same block attributes have a count added. Eg (002 1100 001 3) so 3 the same exists. 

 

Your other post ?

 

So in your data you have say 2 x Box,  milk, peach and so on. So what do you do to fix ?

(("DATAPORT NUMBER" "APPLE" "" "1200" "1" "") 
("DATAPORT NUMBER" "Box" "" "1250" "" "") 
("DATAPORT NUMBER" "Box" "" "1250" "" "") 
("DATAPORT NUMBER" "CHERRY" "" "1200" "001" "Yesterday") 
("DATAPORT NUMBER" "Cheeze" "" "1800.9" "1" "Now") 
("DATAPORT NUMBER" "Chocolates" "" "1350" "" "") 
("DATAPORT NUMBER" "DD3" "" "1000" "001" "") 
("DATAPORT NUMBER" "Milk" "" "1700" "1" "Never") 
("DATAPORT NUMBER" "Milk" "" "1700" "1" "Never") 
("DATAPORT NUMBER" "PEACH" "" "1200" "001" "Tomorrow") 
("DATAPORT NUMBER" "PEACH" "" "1200" "001" "Tomorrow") 
("DATAPORT NUMBER" "PEAR" "" "1200" "001" "Tomorrow") 
("DATAPORT NUMBER" "PIE" "" "1100" "003" "") 
("DATAPORT NUMBER" "PIE" "" "1100" "003" "") 
("DATAPORT NUMBER" "Picles" "" "1400" "" "") 
("DATAPORT NUMBER" "Yogurt" "" "1800.9" "2" ""))

 

Posted (edited)

You should remove your other post. It is confusing to have two posts. I sorted all the blocks in that dwg. Still not sure your criteria for changing which attribute value.

 

(("DATAPORT NUMBER" "APPLE" "" "1200" "1" "") 
("DATAPORT NUMBER" "Box" "" "1250" "" "") 
("DATAPORT NUMBER" "Box" "" "1250" "" "") 
("DATAPORT NUMBER" "CHERRY" "" "1200" "001" "Yesterday") 
("DATAPORT NUMBER" "Cheeze" "" "1800.9" "1" "Now") 
("DATAPORT NUMBER" "Chocolates" "" "1350" "" "") 
("DATAPORT NUMBER" "DD3" "" "1000" "001" "") 
("DATAPORT NUMBER" "Milk" "" "1700" "1" "Never") 
("DATAPORT NUMBER" "Milk" "" "1700" "1" "Never") 
("DATAPORT NUMBER" "PEACH" "" "1200" "001" "Tomorrow") 
("DATAPORT NUMBER" "PEACH" "" "1200" "001" "Tomorrow") 
("DATAPORT NUMBER" "PEAR" "" "1200" "001" "Tomorrow") 
("DATAPORT NUMBER" "PIE" "" "1100" "003" "") 
("DATAPORT NUMBER" "PIE" "" "1100" "003" "") 
("DATAPORT NUMBER" "Picles" "" "1400" "" "") 
("DATAPORT NUMBER" "Yogurt" "" "1800.9" "2" ""))

 

Edited by BIGAL
Posted

The other thread (page 1) is the source of Lee mac's code and Terry.T's addition to select block to receive the incremental numbers. Admin moved this request to this new thread. After realized this I posted same thing here. Sorry for the confusion. Adm can delete my request there if needed.

 

From the original code ( assigns incremental numbers to a Port_Number attribute of all instance of one block) I'm wondering if 2 things can happen:

1st of multiple instance of one block, if matching attribute values in a Part_Number attribute exists in 2 or more blocks, those blocks receive the same or matching incremental number in their Port_Number attribute.

2nd is the code decides, when assigning incremental numbers, the order of those numbers to which blocks receive a # based on priority levels from 3 attributes. Sort_Order is attribute 1st priority. If values match in Sort_Order the code looks to Sort_Order2's attribute value. If they match there also then the code looks to Sort_Order3's value before assigning incremental numbers.  

 

Attached is a cleaner file to test. Blocks (been exploded) on the left "example" is the end result. Blocks on the right one can test code on them. hope this helps. Thanks

PNO TEST-LSP FOR NUMBING4.dwg

Posted

Just post a link to the other thread as a reference.

 

Other thread for reference...

 

 

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