[->UB]
[610UB125]^C^C(BlockInsert "UniversalBeams_610UB125");scale;1;
[610UB113]^C^C(BlockInsert "UniversalBeams_610UB113");scale;1;
[610UB101]^C^C(BlockInsert "UniversalBeams_610UB101");scale;1;
[--]
(defun BlockInsert (blkname)
(setq time (rtos (getvar "CDATE") 2 6)) ; Format YYYYMMDD.HHMMSS
(setq year (substr time 3 2))
(setq month (substr time 5 2))
(setq day (substr time 7 2))
(setq hour (substr time 10 2))
(setq minutes (substr time 12 2))
(setq seconds (substr time 14 2))
(command "_.-insert" (substr (strcat blkname "-" year month day hour minutes seconds "=" blkname) (+ (vl-string-position (ascii "_") blkname 1) 2)) pause 1 "" 0)
)
I would then have a source file with a bolt as a dynamic block. How can I just add the dynamic block ... at the moment, the dynamic block would be made inside a regular block, which I don't want.
(defun BlockInsert (blkname)
(command "_.-insert" (substr (strcat blkname "-" (menucmd "m=$(edtime,0,yymoddhhmmss)") "=" blkname) (+ (vl-string-position (ascii "_") blkname 1) 2)) pause 1 "" 0)
)
...with the original source file, it's actually the case that there is only the dynamic block definition.
(if (and (not (findfile "STRUCTURAL_STEEL.mnu"))
(findfile "C:\\POP12 StrSt\\STRUCTURAL_STEEL.mnu")
)
(setenv "ACAD" (strcat (getenv "ACAD") "C:\\POP12 StrSt"))
)
(command "._MENULOAD" "STRUCTURAL_STEEL.mnu")
(menucmd "P12=+STRUCTURAL_STEEL.CTOPopSTRUCTURAL_STEEL")
***MENUGROUP=STRUCTURAL_STEEL
***POP12
**CTOPopSTRUCTURAL_STEEL
[Structural Steel]
[--]
[->Beams]
[530UB82.0]^C^C(BlockInsert "UniversalBeams_530UB82.0");scale;1;
[360UB50.7]^C^C(BlockInsert "UniversalBeams_360UB50.7");scale;1;
[<-150UB18.0]^C^C(BlockInsert "UniversalBeams_150UB18.0");scale;1;
[--]
[->Bolts]
[M12]^C^C(BlockInsert "Bolts_M12");scale;1;
[M20]^C^C(BlockInsert "Bolts_M20");scale;1;
[M36]^C^C(BlockInsert "Bolts_M36");scale;1;
[<-DYNAMIC BOLT]^C^C(BlockInsert "Bolts_DYNAMIC BOLT");scale;1;
[--]
(defun BlockInsert (blkname)
(command "_.-insert" (substr (strcat blkname "-" (menucmd "m=$(edtime,0,yymoddhhmmss)") "=" blkname) (+ (vl-string-position (ascii "_") blkname 1) 2)) pause 1 "" 0)
)
Lee Mac, the source drawing isn't actually opened at all.
1. How can you tell that Bolts_DYNAMIC BOLT.dwg is a reference and not the dynamic block itself.
2. That's the second time you mentioned WBLOCk but I still don't understand the concept. One of the things it does is it takes the elements and places them in a separate file. But I already have a separate file. I tried WBLOCk on Bolts_DYNAMIC BOLT.dwg to create another file, and inserted again from the menu but could not see any difference. I didn't get the prompt "Open in Block Editor".
3. With your last note that the existing drawing contains a reference and then it becomes nested ... with the other reference drawings such as 530UB82.0, these are just lines and arcs but they become a block when using the routine "BlockInsert".