Quantcast
Channel: MicroStation Programming Forum - Recent Threads
Viewing all articles
Browse latest Browse all 7260

RE: [CONNECT VBA] Modify ComplexShape

$
0
0

[quote user="Maxim Kulikov"]

If myEnum.Current.IsComplexShapeElement Then
  Dim ee As ElementEnumerator
  Set ee = myEnum.Current.AsComplexShapeElement.GetSubElements
  While ee.MoveNext
    ...
  Loop
EndIf

[/quote]

Be more descriptive with your variable names — the right names tell a better story:

If myEnum.Current.IsComplexShapeElement Then
  Dim components As ElementEnumerator
  Set components = myEnum.Current.AsComplexShapeElement.GetSubElements
  While components.MoveNext
    ...
  Loop
EndIf
Public Function ModifyVertexes(component As Element, PCo() As Point3d, PTm() As Double) As Long

In your ModifyVertexes function, you rewrite the component element.  You might try to rewrite the parent of the component (the complex shape) after modifying its component:

Set oParent = myEnum.Current
Modify = ModifyVertexes(components.Current, PCo, PTm)
If 0 < Modify Then
  oParent.Rewrite
End If

See if that makes any difference.


Viewing all articles
Browse latest Browse all 7260

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>