current sheet revision field block update with another block fielded attribute

current sheet revision field block update with another block fielded attribute

mduvalAA6EJ
Enthusiast Enthusiast
1,509 Views
19 Replies
Message 1 of 20

current sheet revision field block update with another block fielded attribute

mduvalAA6EJ
Enthusiast
Enthusiast
hello I created a block attachment containing attributes (32) of "1 to 8" (8 rows 4 columns) + "0" (4) (1 row 4 columns)
 linked to fields, I would like to create a lisp which selects the values ​​of the columns of the last filled row (revision) to transpose it to the attributes of row 0 "current sheet"field, and updated automatically..is it possible to do this with lisp programming? thank you very much

 

0 Likes
1,510 Views
19 Replies
Replies (19)
Message 2 of 20

ВeekeeCZ
Consultant
Consultant

@mduvalAA6EJ wrote:
hello I created a block attachment containing attributes (32) of "1 to 8" (8 rows 4 columns) + "0" (4) (1 row 4 columns) linked to fields, I would like to create a lisp which selects the values ​​of the columns of the last filled row (revision) to transpose it to the attributes of row 0 "current sheet"field, and updated automatically..is it possible to do this with lisp programming? thank you very much

 


Posted to better readability.

0 Likes
Message 3 of 20

mduvalAA6EJ
Enthusiast
Enthusiast

here is the dwg to understand what i am trying to do

 

work with the sheets and insert a table with the sheet list as well as their last revision

0 Likes
Message 4 of 20

mduvalAA6EJ
Enthusiast
Enthusiast

what I want is that the lisp takes the last value entered in the attributes between row 1 to 8 and put it in the fields of row 0 ... example if there is something registered in row 1 and that we add data in the field row 2, it is the row 2 which is registered in the field 0 ... the field 1 to 8 will be modified from the ssm and the field 0 will be automatically modified by the lisp, ideally a function that performs the task without me having to open each drawing and run it ...

0 Likes
Message 5 of 20

mduvalAA6EJ
Enthusiast
Enthusiast

ca pourrait aussi etre l'inverse lorsque je change la valeur des field de la rangée 0 avec le ssm ceal ajoute une ligne d'attribut ou de field (de 1 @ 😎 pour chaque changement...

0 Likes
Message 6 of 20

patrick.emin
Alumni
Alumni

Hello @mduvalAA6EJ can you keep the discussion in English please?


Patrick Emin animateur de la communauté francophone


Vous avez trouvé un message utile? Alors donnez un "J'aime" à ce message!
Votre question a eu une réponse satisfaisante? Voulez vous avoir l'amabilité de cliquer sur le bouton
 APPROUVER LA SOLUTION  en bas de la réponse qui apporte une solution?
Signez notre Livre d'Or
0 Likes
Message 7 of 20

mduvalAA6EJ
Enthusiast
Enthusiast

i can translate with this option ... do you can?

0 Likes
Message 8 of 20

mduvalAA6EJ
Enthusiast
Enthusiast

it could also be the other way around when I change the field value of row 0 with the ssm ceal adds an attribute or field row (from 1 @ 😎 for each change ...

0 Likes
Message 9 of 20

mduvalAA6EJ
Enthusiast
Enthusiast

the row 1 to 8 or more can be diesel expression value of  field row 0 when it change only.... see diesel expression change https://knowledge.autodesk.com/support/autocad-lt/learn-explore/caas/CloudHelp/cloudhelp/2019/ENU/Au...

0 Likes
Message 10 of 20

mduvalAA6EJ
Enthusiast
Enthusiast

sorry I'm not very used to the forum but this could be an example we have the field A in the sheet set manager (SSM) it is copied in the attributes 0, the attribute 0 creates a line 1 ... if we change A so it is no longer equal to 0 so create a line 2 etc

0 Likes
Message 11 of 20

mduvalAA6EJ
Enthusiast
Enthusiast

exemple we have variable
a ; SSM FIELD
0 ; LAST SSM FIELD WAS MADE
1 ; LAST 0 VALUE CHANGE #1
2 ; LAST 0 VALUE CHANGE #2
...TO 8 or more

first A= ###
if A change write value of a to 0... if 0 change write value of 0 change to 1 if 1 change write value of 1 to 2;; .. etc

i think the best way is the change on attribute 0 to 8 are diesel automate function

to do this is "if not equal"

and diesel ad line 1 to 8 one at time by change (exemple) but it can be more

the line a and 0 to 8 information is

rev number - date - description - by

0 is not printed but it can view on dwg file
1 to 8 is like on a revision table draw in the dwg file
A is a SSM field
A can be use to insert table projetct drawing and revison on main sheet

excuse my english

0 Likes
Message 12 of 20

mduvalAA6EJ
Enthusiast
Enthusiast

does someone can help me with this? excuse my english

 

;;; 2021-nov-03 by Martin Duval from Rochon experts Infrastructel

;;; revision sheet lisp for autocad

;;; REC_REVISION

;; dwg document property add this to this lisp work...

;CurrentSheetRevisionBy

;00SheetRevisionNumber
;00SheetRevisionNumber
;00SheetRevisionDate
;00SheetIssuePurpose
;00SheetRevisionBy

;01SheetRevisionNumber
;01SheetRevisionDate
;01SheetIssuePurpose
;01SheetRevisionBy

;02SheetRevisionNumber
;02SheetRevisionDate
;02SheetIssuePurpose
;02SheetRevisionBy

(defun c:rec_revision

(vl-load-com)

(setq dwgrevARN (vlax-get-Property dProps 'RevisionNumber))

(setq dwgrevARD (vlax-get-Property dProps 'RevisionDate))

(setq dwgrevAIP (vlax-get-Property dProps 'IssuePurpose))

(setq dwgrevBY (vlax-get-Property dProps 'CurrentSheetRevisionBy))

(setq dwgrev00RN (vlax-get-Property dProps '00SheetRevisionNumber))
(setq dwgrev00RD (vlax-get-Property dProps '00SheetRevisionDate))
(setq dwgrev00IP (vlax-get-Property dProps '00SheetIssuePurpose))
(setq dwgrev00BY (vlax-get-Property dProps '00SheetRevisionBy))

(setq dwgrev01RN (vlax-get-Property dProps '01SheetRevisionNumber))
(setq dwgrev01RD (vlax-get-Property dProps '01SheetRevisionDate))
(setq dwgrev01IP (vlax-get-Property dProps '01SheetIssuePurpose))
(setq dwgrev01BY (vlax-get-Property dProps '01SheetRevisionBy))

(setq dwgrev02RN (vlax-get-Property dProps '02SheetRevisionNumber))
(setq dwgrev02RD (vlax-get-Property dProps '02SheetRevisionDate))
(setq dwgrev02IP (vlax-get-Property dProps '02SheetIssuePurpose))
(setq dwgrev02BY (vlax-get-Property dProps '02SheetRevisionBy))

(cond
( (=/ dwgrev00RN dwgrevARN)
(setq (vlax-get-Property dProps '00SheetRevisionNumber) dwgrev00RN)
(setq 0 DWGREV)
)

( (=/ dwgrev01RN dwgrev00RN) (= 0 REV)
(setq (vlax-get-Property dProps '00SheetRevisionNumber) dwgrev01RN)
(setq 1 DWGREV)
)

( (=/ dwgrev02RN dwgrev01RN) (= 1 REV)
(setq (vlax-get-Property dProps '00SheetRevisionNumber) dwgrev01RN)
(setq 2 DWGREV)
)

(princ)
)

0 Likes
Message 13 of 20

mduvalAA6EJ
Enthusiast
Enthusiast

this is a revision of my routine.... i hope someone help me with that...

 

 

;;; 2021-nov-03 by Martin Duval from Rochon experts Infrastructel

;;; revision sheet lisp for autocad

;;; REC_REVISION

;; dwg document property (DWGPROP) add this to this lisp work...

;CurrentSheetRevisionBy

;00SheetRevisionNumber
;00SheetRevisionNumber
;00SheetRevisionDate
;00SheetIssuePurpose
;00SheetRevisionBy

;01SheetRevisionNumber
;01SheetRevisionDate
;01SheetIssuePurpose
;01SheetRevisionBy

;02SheetRevisionNumber
;02SheetRevisionDate
;02SheetIssuePurpose
;02SheetRevisionBy

(defun c:rec_revision

(vl-load-com)

(setq dwgrevRN (vlax-get-Property dProps 'RevisionNumber))

(setq dwgrevRD (vlax-get-Property dProps 'RevisionDate))

(setq dwgrevIP (vlax-get-Property dProps 'IssuePurpose))

(setq dwgrevBY (vlax-get-Property dProps 'CustomCurrentSheetRevisionBy))

(setq dwgrev00RN (vlax-get-Property dProps 'Custom00SheetRevisionNumber))
(setq dwgrev00RD (vlax-get-Property dProps 'Custom00SheetRevisionDate))
(setq dwgrev00IP (vlax-get-Property dProps 'Custom00SheetIssuePurpose))
(setq dwgrev00BY (vlax-get-Property dProps 'Custom00SheetRevisionBy))

(setq dwgrev01RN (vlax-get-Property dProps 'Custom01SheetRevisionNumber))
(setq dwgrev01RD (vlax-get-Property dProps 'Custom01SheetRevisionDate))
(setq dwgrev01IP (vlax-get-Property dProps 'Custom01SheetIssuePurpose))
(setq dwgrev01BY (vlax-get-Property dProps 'Custom01SheetRevisionBy))

(setq dwgrev02RN (vlax-get-Property dProps 'Custom02SheetRevisionNumber))
(setq dwgrev02RD (vlax-get-Property dProps 'Custom02SheetRevisionDate))
(setq dwgrev02IP (vlax-get-Property dProps 'Custom02SheetIssuePurpose))
(setq dwgrev02BY (vlax-get-Property dProps 'Custom02SheetRevisionBy))

(setq 100 REVRN)
(setq 100 REVRD)
(setq 100 REVIP)
(setq 100 REVBY)


(cond
(
(/= dwgrev00RN dwgrevRN)
(setq (vlax-get-Property dProps 'Custom00SheetRevisionNumber) dwgrevRN)
(setq 0 REVRN)
)
)

(if
(and
(/= dwgrev01RN dwgrev00RN)
(= 0 REVRN)
)
(setq (vlax-get-Property dProps 'Custom01SheetRevisionNumber) dwgrevRN)
(setq 1 REVRN)
)

(if
(and
(/= dwgrev02RN dwgrev01RN)
(= 1 REVRN)
)
(setq (vlax-get-Property dProps 'Custom02SheetRevisionNumber) dwgrevRN)
(setq 2 REVRN)
)

(princ)
)

0 Likes
Message 14 of 20

pbejse
Mentor
Mentor

What you're asking is fairly easy ( I think 🙂 ).

Its just confusing. Can you post a drawing file showing before and after?

And whats with this?

(setq (vlax-get-Property dProps 'Custom00SheetRevisionNumber) dwgrevRN)

 Appears to be missing a variable name?

 

0 Likes
Message 15 of 20

mduvalAA6EJ
Enthusiast
Enthusiast

heres the files ... (work with the same folder or reorganise it)

 

excuse my english

 

thank you very much!

0 Likes
Message 16 of 20

mduvalAA6EJ
Enthusiast
Enthusiast

I use "DWGPROP" to créate field and manipulate with ssm and lisp function "rec_revision" i dont know if they are a sample better way to do this like name the object on revision issue, but i think that coul be working fine... 

to update the dwg in each issue i think i could run script that open each drawing and run rec_revison on each or use a diesel macro to do run it in dwg but i dont know now how to do this its ... 

0 Likes
Message 17 of 20

mduvalAA6EJ
Enthusiast
Enthusiast

here a new version of rec_revision
there is a bug, I don't know how to find the exact name of the fields I want to put in the function

0 Likes
Message 18 of 20

mduvalAA6EJ
Enthusiast
Enthusiast

new revision

0 Likes
Message 19 of 20

mduvalAA6EJ
Enthusiast
Enthusiast

new version of rec_revision

 

error message "too few argument" but i think that coulb working .. someone help me :)?

 

use this file i post before... and excuse my english

 

2021-11-05.dst

 

m101 test.dwg

 


REC_templateSS-2021-nov-05.dwt

 
0 Likes
Message 20 of 20

mduvalAA6EJ
Enthusiast
Enthusiast

new version of rec_revision (2021-nov-08 - 2)

 

error message "too few argument" but i think that coulb working .. someone help me :)?

and excuse my english

use this file i post before... 

2021-11-05.dst

m101 test.dwg

REC_templateSS-2021-nov-05.dwt

0 Likes