hoover_32091 Posted December 1, 2011 Posted December 1, 2011 Greetings, I am trying to figure out how to program the following: 1. Invoke a command that will first ask the user to select the location of the source drawing. For example (setq TblockSourceFile (getfiled "Select Title Block Source Drawing" "p:/" "dwg" 4)) 2. Programmatically "harvest" the attributes and their values from a block named "TITLEBLOCK". 3. Ask the user to select the target drawing or ".dst" file in order to update the Custom Property Values in the sheet set. I hope that made sense. I'm not sure whether to have the target drawing open or if there is some way to update the ".dst" file directly. For example: Match value of Custom Sheet Set Property "Project Name" to value of "Project Name" attribute in "TITLEBLOCK". That is pretty much all of the functionality I'm looking for. I'm not sure if LISP can be used to manage Sheet Set Operations so I might need to use VB.NET (opinions?). I've asked this question on another forum and got told to look at the help file. I have thoroughly examined the help file but cannot seem to piece everything together. Any help would be greatly appreciated. Quote
irneb Posted December 3, 2011 Posted December 3, 2011 You'd probably be better off using Net (VB/C#) for working with SS. But there are some functions in the vlisp section which can help. Also you can use ObjectDBX (search in this forum for samples) to read the attribute info from unopened DWG files. In both cases you're going to extensively use ActiveX interfaces, so I'd advise getting pretty comfortable with the vlisp functions (vlax/vla) before going at it head on. If you haven't done so, then it might be easier to just go with the Net libraries instead, they're similar to ActiveX - just differently structured and not available in lisp. Also you might find more samples for what you're after. Quote
BlackBox Posted December 3, 2011 Posted December 3, 2011 Perhaps I misunderstood why this level of functionality would be necessary. We use SSM for all projects, and use Sheet Set (SS) Custom Properties in our .DST Template that are used to store this type of project information, and is populated in our Title Blocks, as the attributes in our Title Blocks use Fields that reference said SS Custom Properties. For example: If the client name, or project name were to change... I simply Right Click the SS, Properties, Custom Properties, then modify as needed. Done. All sheets within the SS have automagically just been updated... If you have any sheets open, a simple REGEN will update the Field(s). You can also directly PUBLISH all sheets (without opening them in the Editor) and all changes made to SS Custom Properties will be reflected accordingly. I do not believe that you require programming to accomplish what you need... just some prior planning. ** Edit to add - AutoCAD 2011 has incorporated SSM functionality into Visual LISP Help (acad_dev181.chm), See "Sheet Set Objects Reference" node. :wink: *** Edit to add - Here's a link to the Online version of same, for AutoCAD 2012: Sheet Set Objects Reference Quote
irneb Posted December 4, 2011 Posted December 4, 2011 Yep, RM ... I think you've explained it quite well. I think the OP's problem may be that they've not used SSM from the start, and now want to take the already typed in values from the TB into the SM properties instead of retyping them. I.e. get the link the other way round than the fields are doing. This would probably be a once off (or at least only when it wasn't done right to begin with - i.e. someone's typed over the field in the attribute). Thus it should fix such "problem" by populating the SSM with the new value and recreate the field (unless of course I'm missing it totally). As for the VL ... if you already have the experience in VL, then sure it would be quicker to just go with that. It's just that it's a pain to have to learn something new all the time: I'm in the process of going into the Revit scene:ouch: ... wish I could lisp in that! Id have at least had something to show for it by this time! Quote
BlackBox Posted December 4, 2011 Posted December 4, 2011 Yep, RM ... I think you've explained it quite well. *Tips hat to my Zef slang brotha* I think the OP's problem may be that they've not used SSM from the start, and now want to take the already typed in values from the TB into the SM properties instead of retyping them. I.e. get the link the other way round than the fields are doing. This would probably be a once off (or at least only when it wasn't done right to begin with - i.e. someone's typed over the field in the attribute). Thus it should fix such "problem" by populating the SSM with the new value and recreate the field (unless of course I'm missing it totally). Given that SSM has not been used from the start, perhaps the OP would find simple removing the title blocks from each sheet type (i.e., Plan, Profile, Cross Section, Details, whatever...) and add an XREFed title block for that sheet type? This would be significantly less production time loss, and would not require learning to code in Visual LISP (perhaps even specifically ObectBDX?)... What I propose could easily be done via Script if LISP is not an option. As for the VL ... if you already have the experience in VL, then sure it would be quicker to just go with that. It's just that it's a pain to have to learn something new all the time: I'm in the process of going into the Revit scene:ouch: ... wish I could lisp in that! Id have at least had something to show for it by this time! I can relate... Not to Revit specifically, but I'm now finding myself working in Microstation (MS) *Threw up a little in my mouth*... I thought I was saving myself time / effort jumping from AutoLISP / Visual LISP --> to --> .NET, when in fact I now (thanks to MS) have to learn VBA, if not MDL (Like ObjectARX, MDL is C++ for MS)... Oh, or there's Visual Basic (Not to be confused with Visual Basic for Applications, or Visual Basic .NET... Friggin' Basic) LoL Quote
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.