
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello there,
I already wrote concerning my problem in a different thread but was able now to figure out that the bad performance is relied to movement of adaptive components.
As far as I understand adaptive components are placed on default points and then have to be moved via code to the corresponding position. Because I am working with gauss krüger coordinates this is quite a distance...
I found another thread here giving the solution of only assigning the corresponding coordinates but this does not work in Python? (e.g. point.Position = refpt)
My questions:
Is there a different approach of placing the adaptive family straight on the desired points?
Or is there a possibility to batch the movement of points? I found the method FamilyInstanceCreationData(famsymb,iList)but could not make it run in python nor figure out whether it is only for single point families.
I am working with RPS, below please see my code.
Any help would be greatly appreciated!
My approach is the following:
# place family instance, get default placement points, subtract from my desired coordinates (list) and move element
inst = AdaptiveComponentInstanceUtils.CreateAdaptiveComponentInstance(
doc, inst)
placePointIds = []
placePointIds = AdaptiveComponentInstanceUtils.GetInstancePlacementPointElementRefIds(
inst)
for ind, item in enumerate(placePointIds):
# assign a point object to refpt, refpt is the orginal point of the family, newpt the new point derived from pt information
refpt = doc.GetElement(item)
newpt = pt[ind]
trans = newpt.Subtract(refpt.Position)
ElementTransformUtils.MoveElement(doc, item, trans)
Solved! Go to Solution.