luongthevinh Posted October 22, 2016 Share Posted October 22, 2016 Hello everybody. I have a ploblem to count a many attributes in cad. Example: I have a rectangula duct with Height x Weight x Length. I want a lisp count Attributes with couple include: "Height x Weight x Length" In forum have a lisp but it only count individual there attributes. I want include "Height x Weight x Length" Thank's so much! Quote Link to comment Share on other sites More sharing options...
David Bethel Posted October 22, 2016 Share Posted October 22, 2016 Can you post a sample DWG ? Quote Link to comment Share on other sites More sharing options...
luongthevinh Posted October 22, 2016 Author Share Posted October 22, 2016 I mean is if use lisp http://www.lee-mac.com/countattributevalues.html , theresults obtained indicate that the value of the function Attribute, but I mean but my opinion is obtained both terms of each "block". Example the cad file https://drive.google.com/open?id=0BzeFfYduaZE3aG5wcHBveldmTzA include Rectangular Duct on parameters including the length, width, height of the duct. When using the peel only part lisp on each individual value. I need to strip out the number as sets Example: Duct: "300x200 L = 1120mm " quantity 1, such as individual so not like lisp is peeled off each value: 300 quantity 1 ****************************** 200 quantity 1 ****************************** 1120 quantity 1 I want lisp to do this. Thank's a lot. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted October 23, 2016 Share Posted October 23, 2016 Did you try DATAEXTRACTION ? Use wblock and cut a sample part of your dwg and post here the link did not work. Quote Link to comment Share on other sites More sharing options...
David Bethel Posted October 23, 2016 Share Posted October 23, 2016 While I don't quite understand your exact needs, this will create a list of all unique tagname/attribute values with their respective counts and sum values [b][color=BLACK]([/color][/b]defun c:att-sumc [b][color=FUCHSIA]([/color][/b]/ ss i en an ad av ai tn as d q s x al[b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]while [b][color=NAVY]([/color][/b]not ss[b][color=NAVY])[/color][/b] [b][color=NAVY]([/color][/b]princ [color=#2f4f4f]"\nSelect ATTRIButed INSERTs: "[/color][b][color=NAVY])[/color][/b] [b][color=NAVY]([/color][/b]setq ss [b][color=MAROON]([/color][/b]ssget '[b][color=GREEN]([/color][/b][b][color=BLUE]([/color][/b]0 . [color=#2f4f4f]"INSERT"[/color][b][color=BLUE])[/color][/b][b][color=BLUE]([/color][/b]66 . 1[b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]setq i 0[b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]while [b][color=NAVY]([/color][/b]setq en [b][color=MAROON]([/color][/b]ssname ss i[b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b] [b][color=NAVY]([/color][/b]setq an [b][color=MAROON]([/color][/b]entnext en[b][color=MAROON])[/color][/b] ad [b][color=MAROON]([/color][/b]entget an[b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b] [b][color=NAVY]([/color][/b]while [b][color=MAROON]([/color][/b]= [color=#2f4f4f]"ATTRIB"[/color] [b][color=GREEN]([/color][/b]cdr [b][color=BLUE]([/color][/b]assoc 0 ad[b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b] [b][color=MAROON]([/color][/b]setq av [b][color=GREEN]([/color][/b]cdr [b][color=BLUE]([/color][/b]assoc 1 ad[b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b] ai [b][color=GREEN]([/color][/b]atoi av[b][color=GREEN])[/color][/b] tn [b][color=GREEN]([/color][/b]cdr [b][color=BLUE]([/color][/b]assoc 2 ad[b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b] as [b][color=GREEN]([/color][/b]strcat tn av[b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b] [b][color=MAROON]([/color][/b]if [b][color=GREEN]([/color][/b]not [b][color=BLUE]([/color][/b]assoc as al[b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b] [b][color=GREEN]([/color][/b]setq al [b][color=BLUE]([/color][/b]cons [b][color=RED]([/color][/b]list as 1 ai[b][color=RED])[/color][/b] al[b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b] [b][color=GREEN]([/color][/b]progn [b][color=BLUE]([/color][/b]setq d [b][color=RED]([/color][/b]assoc as al[b][color=RED])[/color][/b] q [b][color=RED]([/color][/b]1+ [b][color=PURPLE]([/color][/b]nth 1 d[b][color=PURPLE])[/color][/b][b][color=RED])[/color][/b] s [b][color=RED]([/color][/b]+ ai [b][color=PURPLE]([/color][/b]nth 2 d[b][color=PURPLE])[/color][/b][b][color=RED])[/color][/b] x [b][color=RED]([/color][/b]list as q s[b][color=RED])[/color][/b] al [b][color=RED]([/color][/b]subst x d al[b][color=RED])[/color][/b][b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b] [b][color=MAROON]([/color][/b]setq an [b][color=GREEN]([/color][/b]entnext an[b][color=GREEN])[/color][/b] ad [b][color=GREEN]([/color][/b]entget an[b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b] [b][color=NAVY]([/color][/b]setq i [b][color=MAROON]([/color][/b]1+ i[b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]prin1 al[b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]prin1[b][color=FUCHSIA])[/color][/b][b][color=BLACK])[/color][/b] This may help to find a starting point -David Quote Link to comment Share on other sites More sharing options...
luongthevinh Posted October 27, 2016 Author Share Posted October 27, 2016 How to say you understand now. In short I have a problem counting volume on drawing HVAC ductwork. In the drawing, I draw the duct by this dynamic block as file i sent. The problem is that I need a lisp have counting the amount of duct with sizes and different lengths. So, So I really hope you can help me write a lisp to do this. If doing so, it increases work efficiency is very high. Once again I would like to thank all of you for helping me. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.