Home -
General /
All posts - Adding all Components from a folder to a map
|
Is it possible to put alle Components from a folder "Import" to a existing map called "Map" via script?? The folder "Import" have a lot of aerial views, which I have to put into the "Map". thx in advance
|
|
This script will add all drawings and images that are inside a folder named "Import" onto a map named "Map" 'vbscript Sub Main set comps = document.componentset set fld = comps("Import") set childs = fld.Children set map = comps("Map") set lyrs = map.Layerset for each c in childs if c.Type = ComponentDrawing or c.Type = ComponentImage then test = 0 'check if the component is already on the map for each l in lyrs if l.Component.Name = c.Name then test = test + 1 end if next if test = 0 then 'the component is not on the map so add it set newLyr = document.newLayer(c) lyrs.Add newLyr end if end if set lyrs = map.LayerSet next End Sub
"The blessing in life is finding the torture you are comfortable with." - Jerry Seinfeld, 6/26/2013 |
|
thx, your script makes a great job. Shows your picture Ted Nugent? When I was young I habe been a fan of him.
|
|
You're welcome. No, that picture is none other than Mr. Frank Zappa, the Italian virtuoso composer extraordinaire.
"The blessing in life is finding the torture you are comfortable with." - Jerry Seinfeld, 6/26/2013 |
|
Your place or mine?
https://github.com/mdsumner |