How to show only reference dimensions

How to show only reference dimensions

atomic.lex
Enthusiast Enthusiast
530 Views
2 Replies
Message 1 of 3

How to show only reference dimensions

atomic.lex
Enthusiast
Enthusiast

Hi all,

 

i use ilogic for drawing dimentions. but i don't need all of them. Thats why a make a new sketch with reference dimentions. Those dimansions parameters ends with "_REF". I've tryed to use a code, which shows dimentions depends of parameter names, but it works not for reference dimentions. How can i mike it posable to use if for reference parameters too?

 

	For Each oView In oViews
		oRetDims = oDims.GetRetrievableDimensions(oView)	
		If oRetDims.Count > 0 Then 
			dimsEnum = oDims.Retrieve(oView)
			For  Each  oDim In  dimsEnum
				If oDim.Retrieved Then 
					paramName = Dim.RetrievedFrom.Parameter.Name
					If Not paramName.EndsWith("_REF") Then 
						oDim.Delete
					End If 
				End  If 
			Next 
		End If		
	Next

 

Thanks from Atomic Z

 

Have a nice day ☺

0 Likes
531 Views
2 Replies
Replies (2)
Message 2 of 3

t_remal
Autodesk
Autodesk

Hi,

 

could you please share the dataset too?

I can't reproduce any issue with the code you sent - parameters not ending with _REF are correctly deleted.

 

Thanks,

Lubomir

0 Likes
Message 3 of 3

atomic.lex
Enthusiast
Enthusiast

Hi Lubomir,

 

 

this is only a part of code, which works not only for that task. For this task it should be so:

 

Dim oDoc As Document
 oDoc = ThisDoc.Document

Dim oViews As DrawingViews
 oViews = oDoc.ActiveSheet.DrawingViews

Dim oDims As GeneralDimensions
 oDims = oDoc.ActiveSheet.DrawingDimensions.GeneralDimensions

Dim oRetDims As ObjectCollection

Dim dimsEnum As GeneralDimensionsEnumerator

For Each oView In oViews
 oRetDims = oDims.GetRetrievableDimensions(oView)
 If oRetDims.Count > 0 Then 
  dimsEnum = oDims.Retrieve(oView)
  For Each oDim In dimsEnum
   If oDim.Retrieved Then 
    paramName = oDim.RetrievedFrom.Parameter.Name
    If Not paramName.EndsWith("_REF") Then 
     oDim.Delete
    End If
   End If
  Next
 End If
Next

But it woks only for sketsh dimentions and not for references.

 

 

Have a nice day

 

Atomic Z

0 Likes