Tipo166 Posted September 9, 2008 Share Posted September 9, 2008 Hello All! For ref, recent thread - "calling a function to return an entity" I wrote a couple small subs to generate a region. What I am after is the area of that region (a property of region objects) and passing it to a user form. First solution was trying to use SelectionSets...grrrrrr.....this is my second solution path (SEEMS less harder - humor): Currently creating a dictionary of the areas of the regions then passing those values into my form. I have reviewed several examples and believe my code is reasonably accurate (ref "AddObject" method & example -Acad Developers Help). However I can not get the area(s) to populate in the dictionary? Watch shows the dictionary creation as checking out. I am assuming once a dictionary (and its contents) is created it is a perminent part of the DWG i.e. accessable the next time the DWG is opened? 1) Anyone familiar with this error? "AcRxClassName entry is not in the system registry"? 2) does AddObject apply only to ObjectARX objects?? Dictionary creation and AddOject statements: 'Check to see if this dictionary exists if it does not - add it Dim FlrSpcRegsDict As AcadDictionary On Error Resume Next Set FlrSpcRegsDict = ThisDrawing.Dictionaries.Item("Floor_Space_Regions_Dictionary") If Err.Number <> 0 Then Err.Clear Set FlrSpcRegsDict = ThisDrawing.Dictionaries.Add("Floor_Space_Regions_Dictionary") End If 'Uniquely ID this regions area and put in dictionary Dim keyName As String Dim ObjectName As String keyName = "BuildingSQFTreg" className = "SQFTregion" 'Add BuildingSQFT to the dictionary in the drawing BuildingSQFTarea = FlrSpcRegsDict.AddObject(keyName, className) << not working!!! BuildingSQFTarea also checks out as correct with a watch>> The dictionary is created but never has any objects in it (count = 0) so my BuildingSQFTarea is not being stored(?). Label control object of form: Private Sub Total_SqFt_Number_Click() Dim BuildingSQFTarea As Double Dim FlrSpcRegsDict As AcadDictionary Set FlrSpcRegsDict = ThisDrawing.Dictionaries.Item("Floor_Space_Regions_Dictionary") 'Find the object Dim tempObj As Double Set tempObj = FlrSpcRegsDict.GetObject(BuildingSQFTarea) Total_SqFt_Number.Caption = tempObj End Sub 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.