Profile Match Lisp

Profile Match Lisp

eccook
Contributor Contributor
839 Views
7 Replies
Message 1 of 8

Profile Match Lisp

eccook
Contributor
Contributor

Is ther a lsp or command where I can copy a profile style, elivations, ect to another profile? I can not seem to find one and would rather not have to mannualy do it as I will have around 200 profiles.


Screenshot 2025-08-08 091501.png

0 Likes
Accepted solutions (1)
840 Views
7 Replies
Replies (7)
Message 2 of 8

user181
Mentor
Mentor

You should be able to just select one and right click and pick select similar and then change the style on the properties pallet

 

Sorry I just tried and that doesn't work.  You could use the qselect command and set object to profile view or profile whichever you are changing and then in the operator box choose select all and then change the style on the properties pallet

 

0 Likes
Message 3 of 8

eccook
Contributor
Contributor

They style is not the problem at this point. My issue is the Elivations. I would like all of the profiles to have a matching Elivation that goes from -5 to -95. I don't belive that is contrilled by the styles.

0 Likes
Message 4 of 8

hippe013
Advisor
Advisor
Accepted solution

I am assuming you mean ProfileView and not profile. Is that correct? 

 

Below is a lisp that will match the profileView style and elevations from the source ProfileView to the target ProfileViews. 

 

(defun c:PVMatch ( / ssSrc pvSrc ssTrgt style minElev maxElev n pvTrgt)
  (princ "\nSelect Source ProfileView: ")
  (setq ssSrc (ssget ":s+." '(( 0 . "AECC_PROFILE_VIEW"))))
  (if ssSrc
    (progn
      (setq pvSrc (vlax-ename->vla-object (ssname ssSrc 0)))
      (princ "\nSelect Target ProfileViews: ")
      (setq ssTrgt (ssget '(( 0 . "AECC_PROFILE_VIEW"))))
      (if ssTrgt
	(progn
	  (setq style (vlax-get-property pvSrc 'Style))
	  (setq minElev (vlax-get-property pvSrc 'ElevationMin))
	  (setq maxElev (vlax-get-property pvSrc 'ElevationMax))
	  (setq n 0)
	  (repeat (sslength ssTrgt)
	    (setq pvTrgt (vlax-ename->vla-object (ssname ssTrgt n)))
	    (vlax-put-property pvTrgt 'ElevationLocked 0)
	    (vlax-put-property pvTrgt 'ElevationMin minElev)
	    (vlax-put-property pvTrgt 'ElevationMax maxElev)
	    (vlax-put-property pvTrgt 'Style style)
	    (setq n (+ n 1))
	    )
	  )
	)
      )
    )
  (princ)
  )

 

 

 

Message 5 of 8

eccook
Contributor
Contributor

You nailed it! Thank you so much. This will save me so much time. 

0 Likes
Message 6 of 8

Joe-Bouza
Mentor
Mentor

Matching elevations you mean the Profile View PV, not he profiles, right?

 

how were these created that they are all different?

Joe Bouza
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

0 Likes
Message 7 of 8

eccook
Contributor
Contributor

Can this be done with sections as well?

0 Likes
Message 8 of 8

hippe013
Advisor
Advisor

Unfortunately, no. 

 

See this post by @Jeff_M. He explains how the Min & Max Elevations for SectionViews, in the COM API, are read-only. However, he has a solution for this written in C# for the .NET framework. 

 

Solved: Re: How to Edit Elevation (Min and Max) in Section View - Autodesk Community

 

 

0 Likes