Quantcast
Channel: Scripting - McNeel Forum
Viewing all articles
Browse latest Browse all 5791

Trouble Moving Dimension Grips

$
0
0

@Measure wrote:

Background:
When a bunch of geometry that includes dimensions is mirrored, the “architectural tick” style arrows become mirrored as well. I’m writing a script to flip them back.

Problem:

import rhinoscriptsyntax as rs
import scriptcontext as sc

dimGuid = rs.GetObject("Select dimension", custom_filter=rs.IsDimension)
if dimGuid:
	dimObj = sc.doc.Objects.Find(dimGuid)
	rs.EnableObjectGrips(dimGuid, True)
	g = rs.ObjectGripLocations(dimGuid)
	rs.MirrorObject(dimGuid, g[2], g[3])
	rs.ObjectGripLocation(dimGuid, 0, g[0])
	rs.EnableObjectGrips(dimGuid, False)

When I run this code, the dimension does not update. Reading and printing the grip locations before and after shows that the call to rs.ObjectGripLocation at the end has no effect.

I’ve tried several different ways to change the grip locations and nothing has worked. I thought I’d start with this most basic way that I would expect to work and go from there.

(Rhino 5)

EDIT:
It appears to work for Radial Dimensions, but not for Linear Dimensions, Aligned Dimensions, or Angular Dimensions.

Posts: 5

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 5791

Trending Articles