SHOP SKETCH TO BOM CREATE AUTOMATIC

SHOP SKETCH TO BOM CREATE AUTOMATIC

Gaganpatel
Collaborator Collaborator
776 Views
13 Replies
Message 1 of 14

SHOP SKETCH TO BOM CREATE AUTOMATIC

Gaganpatel
Collaborator
Collaborator

Dear Sir,

 

I want shop sketch to BOM create automatic by autocad or excel.

Please see the example file.

Gaganpatel_0-1692382500886.png

 

0 Likes
777 Views
13 Replies
Replies (13)
Message 2 of 14

Kent1Cooper
Consultant
Consultant

Will DATAEXTRACTION do what you want?

Kent Cooper, AIA
0 Likes
Message 3 of 14

Gaganpatel
Collaborator
Collaborator

Dear Sir,

 

Thanks for reply.

Column-B (Section),  Column-C (Length) normal text not a block DATAEXTRACTION not possible.

Please help Sir

0 Likes
Message 4 of 14

Sea-Haven
Mentor
Mentor

Ok that is what I would call drawing index not BOM "Bill of materials".

 

I have something which is what you want but it works on Layouts not Model space. It will need to be modified to suit your block name, attribute tag names and number of columns. Your welcome to have a go.

 

; dwg index to a table
; by Alan H NOV 2013
(defun AH:dwgindex (/ doc objtable ss1 lay ans ans2 plotabs ss1 tag2 tag3 list1 list2 curlayout colwidth numcolumns numrows INC rowheight )

(vl-load-com)
(setq curlayout (getvar "ctab"))
(if (= curlayout "Model")
(princ)
(setvar 'ctab "Model")
) ; end if model

(setq doc (vla-get-activedocument (vlax-get-acad-object)))
(setq curspace (vla-get-paperspace doc))
(setq pt1 (vlax-3d-point (getpoint "\nPick point for top left hand of table:  "))) 

; read values from title blocks

(setq bname "DA1DRTXT") ; title block name

(setq tag2 "DRG_NO") ;attribute tag name
(setq tag3 "WORKS_DESCRIPTION") ;attribute tag name

(setq ss1 (ssget "x"  (list (cons 0 "INSERT") (cons 2 bname))))

(setq INC (sslength ss1))  
(repeat INC
(foreach att (vlax-invoke (vlax-ename->vla-object (ssname SS1 (SETQ INC (- INC 1)) )) 'getattributes) 
        (if (= tag2 (strcase (vla-get-tagstring att)))
            (progn
            (setq ans (vla-get-textstring att))
            (if (/= ans NIL)
            (setq list1 (cons ans list1))
            ) ; if 
            ); end progn
          ) ; end if
        (if (= tag3 (strcase (vla-get-tagstring att)))
          (progn
          (setq ans2 (vla-get-textstring att))
          (if (/= ans2 NIL)
              (setq list2 (cons ans2 list2)) 
           ) ; end if
           ) ; end progn
	 ) ; end if tag3 
    
) ; end foreach

) ; end repeat
(setvar 'ctab curlayout)
(command "Zoom" "E")
(command "regen")


(reverse list1)
;(reverse list2)

; now do table 
(setq numrows (+ 2 (sslength ss1)))
(setq numcolumns 2)
(setq rowheight 0.2)
(setq colwidth 150)
(setq objtable (vla-addtable curspace pt1 numrows numcolumns rowheight colwidth))
(vla-settext objtable 0 0 "DRAWING REGISTER")
(vla-settext objtable 1 0 "DRAWING NUMBER") 
(vla-settext objtable 1 1 "DRAWING TITLE") 

(SETQ X 0)
(SETQ Y 2)

(REPEAT (sslength ss1)
  (vla-settext objtable Y 0 (NTH X LIST1))
  (vla-settext objtable Y 1 (NTH X LIST2))
  (vla-setrowheight objtable y 7)

  (SETQ X (+ X 1))
  (SETQ Y (+ Y 1))
)

(vla-setcolumnwidth objtable 0 55)
(vla-setcolumnwidth objtable 1 170)

(command "_zoom" "e")
(princ)
); end AH defun

(AH:dwgindex)

 

 

0 Likes
Message 5 of 14

Gaganpatel
Collaborator
Collaborator

Dear Sir,

 

Thanks for replay.

I have modify block name & tag value but not working. (i don't no auto lisp programming)

shop sketch to bom create by Excel or auto cad table

Please help me sir

 

 

; dwg index to a table
; by Alan H NOV 2013
(defun AH:dwgindex (/ doc objtable ss1 lay ans ans2 plotabs ss1 tag2 tag3 list1 list2 curlayout colwidth numcolumns numrows INC rowheight )

(vl-load-com)
(setq curlayout (getvar "ctab"))
(if (= curlayout "Model")
(princ)
(setvar 'ctab "Model")
) ; end if model

(setq doc (vla-get-activedocument (vlax-get-acad-object)))
(setq curspace (vla-get-paperspace doc))
(setq pt1 (vlax-3d-point (getpoint "\nPick point for top left hand of table: ")))

; read values from title blocks

(setq bname "SHOP") ; title block name

(setq tag2 "DRG_NO") ;attribute tag name
(setq tag3 "DWGTAG1") ;attribute tag name

(setq ss1 (ssget "x" (list (cons 0 "INSERT") (cons 2 bname))))

(setq INC (sslength ss1))
(repeat INC
(foreach att (vlax-invoke (vlax-ename->vla-object (ssname SS1 (SETQ INC (- INC 1)) )) 'getattributes)
(if (= tag2 (strcase (vla-get-tagstring att)))
(progn
(setq ans (vla-get-textstring att))
(if (/= ans NIL)
(setq list1 (cons ans list1))
) ; if
); end progn
) ; end if
(if (= tag3 (strcase (vla-get-tagstring att)))
(progn
(setq ans2 (vla-get-textstring att))
(if (/= ans2 NIL)
(setq list2 (cons ans2 list2))
) ; end if
) ; end progn
) ; end if tag3

) ; end foreach

) ; end repeat
(setvar 'ctab curlayout)
(command "Zoom" "E")
(command "regen")


(reverse list1)
;(reverse list2)

; now do table
(setq numrows (+ 2 (sslength ss1)))
(setq numcolumns 2)
(setq rowheight 0.2)
(setq colwidth 150)
(setq objtable (vla-addtable curspace pt1 numrows numcolumns rowheight colwidth))
(vla-settext objtable 0 0 "DRAWING REGISTER")
(vla-settext objtable 1 0 "DRAWING NUMBER")
(vla-settext objtable 1 1 "DRAWING TITLE")

(SETQ X 0)
(SETQ Y 2)

(REPEAT (sslength ss1)
(vla-settext objtable Y 0 (NTH X LIST1))
(vla-settext objtable Y 1 (NTH X LIST2))
(vla-setrowheight objtable y 7)

(SETQ X (+ X 1))
(SETQ Y (+ Y 1))
)

(vla-setcolumnwidth objtable 0 55)
(vla-setcolumnwidth objtable 1 170)

(command "_zoom" "e")
(princ)
); end AH defun

(AH:dwgindex)

 

0 Likes
Message 6 of 14

Sea-Haven
Mentor
Mentor

Ok went back and started on it big problems, Item Mark is an Attribute, SECTION is text same with Length. They need to be attributes. yes can find them but so much more code is required to look for a text in a certain location in the title block. The code is based on getting attributes so if you add any text as attributes then I can have another go for you. 

 

Use BEDIT and edit the block, Attdef will allow you to add the attributes you can change the attribute order so the sequence matches the display. Use Attsync to update all blocks. Re post dwg with updated title block.

0 Likes
Message 7 of 14

Gaganpatel
Collaborator
Collaborator

Dear Sir,

This shop drawing is auto generated. Title block not modified.

Please help me any body.

 

 

0 Likes
Message 8 of 14

Sea-Haven
Mentor
Mentor

Ok was the code to auto generate done by some one in your company ? If so could modify that code and add the extra attributes, ask who did it to change. For me to write a look for the text would be at a cost compared to the attribute answer.

0 Likes
Message 9 of 14

Gaganpatel
Collaborator
Collaborator

Dear Sir,

 

Thanks for replay .

This programming is .VLX format, programming developer person contact number switch off, Not possible modify programming.

Attributes block convert to text then all block are text.
Possible text to create Excel bom. example file attached.
Request Please help.

0 Likes
Message 10 of 14

Sea-Haven
Mentor
Mentor

You have made the problem worse by exploding the title block, so the 1st posted dwg is easier to use.

 

Ok what about we go back a step even further you say you have a vlx program making the titles so why not maybe recreate that. That may be a big task. That is why my clients the manager gets a source code version and the users a FAS or VLX version so it can not be stolen. 

 

Ok use bedit add the attributes, then go through the title blocks adding the text as attributes. Then can be done easy.

 

So this is the title block edited.

 

 

 

 

0 Likes
Message 11 of 14

Gaganpatel
Collaborator
Collaborator

Dear Sir,

 

Thanks for replay .

I have generate the shop drawing of your block , but same problem section & length value is only text . your making text block value is layer text.

 

0 Likes
Message 12 of 14

Sea-Haven
Mentor
Mentor

We are going around in circles, I am trying to help but sometimes have limited time, to write a read the text is way harder than reading the correct attributes. 

 

This is your title block after I have ran Bedit and added the 2 extra attributes, you can see where the values are to go. 

 

Ok now, yes you said use a vlx where is the initial information coming from, is it Excel ? If so can make a new program to create the title blocks. Then can have the option to make the dwg index.

SeaHaven_0-1693007050041.png

 

0 Likes
Message 13 of 14

Gaganpatel
Collaborator
Collaborator

 

Any body please help me.

0 Likes
Message 14 of 14

Gaganpatel
Collaborator
Collaborator

Dear Sir,

 

Please help me any body.

Shop drawing to excel bom.

0 Likes