If so, here is the python script to get the origin of a CAD import.
# Import ToDSType(bool) extension method
# Import RevitAPI
#Custom tolist definition provided by Dimitar Venkov
if hasattr(x,'__iter__'): return x
else : return [x]
#unwrap all elements to use with API
items = tolist(UnwrapElement(IN))
#lists to append results to
locations = list()
#iterate through the cad imports
for i in items:
transform = i.GetTotalTransform()
#Assign your output to the OUT variable
OUT = locations
[quote=“MOJTABA256, post:12, topic:22538, full:true”]
Thanks John for your solution but unfortunately it doesn’t work for me your python script. I imported the CAD geometry (for lighting fixtures) in Revit and tried to use your code but it didn’t work. I want to replace them with a lighting fixture Revit Family, but the script couldn’t find the CAD blocks coordinates. Could u please help me to solve this solution? Thanks
I did a simple model to test from the scratch. I opened a new Revit file, placed some lighting fixtures, exported it as DWG, and then opened a new Revit project (ELEC Template), imported the DWG file, and ran the script. They are still OFF although, as shown below, the location coordinates of CAD Blocks and Revit Elements are the same.
Double check the origin of your fixture family. It is not possible that there is an offset with identical location coordinates unless the origins of CAD block and family are different.
It is working fine with the french Revit Electrical template.